Author: Francis Ndungu
Last Updated: Tue, Oct 5, 2021Subrion is an open-source Content Management System (CMS) with a powerful modern administrator interface, suitable for building personal websites, blogs, and corporate web portals. Subrion ships with a modern API, professional-looking templates, and plug-ins that allow you to extend its functionalities and change the look of your website depending on your needs. This guide explains how to install Subrion CMS with a LAMP stack on your Ubuntu 20.04 server.
To complete this tutorial, you require the following:
Connect to your server via SSH and follow the steps below.
Update the package information index.
$ sudo apt update
Install libapache2-mod-php
to allow Apache to communicate with PHP.
$ sudo apt install -y libapache2-mod-php
Enable Apache's mod_rewrite
module to allow Subrion CMS to craft user-friendly URLs.
$ sudo a2enmod rewrite
Restart your web server to load the new modules.
$ sudo systemctl restart apache2
Download and install the unzip
package, which you need to unzip Subrion CMS installation files.
$ sudo apt -y install unzip
Subrion works with either the MySQL or MariaDB server. Follow the steps below to set up a backend for the CMS.
Log in to the MySQL/MariaDB server as root
.
$ sudo mysql -u root -p
Enter the root password for your MySQL/MariaDB server and press ENTER to proceed. Then, run the appropriate SQL statements depending on the database engine you use. Replace EXAMPLE_PASSWORD
with a strong value.
MySQL server:
mysql> CREATE DATABASE subrion;
CREATE USER 'subrion_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'EXAMPLE_PASSWORD';
GRANT ALL PRIVILEGES ON subrion.* TO 'subrion_user'@'localhost';
FLUSH PRIVILEGES;
MariaDB server:
MariaDB> CREATE DATABASE subrion;
GRANT ALL PRIVILEGES on subrion.* TO 'subrion_user'@'localhost' identified by 'EXAMPLE_PASSWORD';
FLUSH PRIVILEGES;
Log out from your database server.
mysql> EXIT;
You should install Subrion CMS in a separate directory to make maintenance and troubleshooting easier in the future.
Create a new subrion
directory under the root of your web server.
$ sudo mkdir -p /var/www/subrion
Take ownership of the new /var/www/subrion
directory.
$ sudo chown -R $USER:$USER /var/www/subrion
Navigate to the new directory.
$ cd /var/www/subrion
Download the latest stable version of the Subrion CMS from the official subrion.org
repository.
$ sudo wget https://tools.subrion.org/get/4.1.5.zip
Unzip the 4.1.5.zip
file to your current directory.
$ sudo unzip 4.1.5.zip
Change ownership of the /var/www/subrion
directory to the www-data
user to allow Apache to read/write to the directory.
$ sudo chown -R www-data:www-data /var/www/subrion
The Apache web server reads virtual hosts configurations from the /etc/apache2/sites-available
directory. Therefore, you need to set up a separate file for the Subrion CMS.
Disable the default 000-default.conf
configuration file.
$ sudo a2dissite 000-default.conf
Create a new subrion.conf
configuration file.
$ sudo nano /etc/apache2/sites-available/subrion.conf
Paste the information below into the new file. Replace example.com
with your server's public IP address or domain name.
<VirtualHost *:80>
ServerName example.com
DocumentRoot "/var/www/subrion"
<Directory "/var/www/subrion">
Require all granted
Options -Indexes +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save and close the file.
Add the new subrion.conf
to the list of enabled sites.
$ sudo a2ensite subrion.conf
Restart the web server to load the new configurations.
$ sudo systemctl restart apache2
Visit the address http://example.com
in a web browser. Replace example.com
with your domain name or public IP address of your server.
Follow the web-based wizard to complete installing Subrion CMS.
Delete the installation script and secure the config.inc.php
file for security purposes.
$ sudo rm /var/www/subrion/install/modules/module.install.php
$ sudo chmod 400 /var/www/subrion/includes/config.inc.php
Append /panel
to your server's public IP address or domain name to access the administration panel. For instance, http://example.com/panel
.
In this guide, you've installed the Subrion CMS with LAMP stack on your Ubuntu 20.04 server. For more information on configuring your Subrion CMS, follow the link below.