Introduction
Subrion 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.
Prerequisites
To complete this tutorial, you require the following:
1. Install Subrion Dependencies and Helper Packages
Connect to your server via SSH and follow the steps below.
Update the package information index.
$ sudo apt updateInstall
libapache2-mod-phpto allow Apache to communicate with PHP.$ sudo apt install -y libapache2-mod-phpEnable Apache's
mod_rewritemodule to allow Subrion CMS to craft user-friendly URLs.$ sudo a2enmod rewriteRestart your web server to load the new modules.
$ sudo systemctl restart apache2Download and install the
unzippackage, which you need to unzip Subrion CMS installation files.$ sudo apt -y install unzip
2. Set Up a Database and a User Account
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 -pEnter 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_PASSWORDwith 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;
3. Download Subrion CMS
You should install Subrion CMS in a separate directory to make maintenance and troubleshooting easier in the future.
Create a new
subriondirectory under the root of your web server.$ sudo mkdir -p /var/www/subrionTake ownership of the new
/var/www/subriondirectory.$ sudo chown -R $USER:$USER /var/www/subrionNavigate to the new directory.
$ cd /var/www/subrionDownload the latest stable version of the Subrion CMS from the official
subrion.orgrepository.$ sudo wget https://tools.subrion.org/get/4.1.5.zipUnzip the
4.1.5.zipfile to your current directory.$ sudo unzip 4.1.5.zipChange ownership of the
/var/www/subriondirectory to thewww-datauser to allow Apache to read/write to the directory.$ sudo chown -R www-data:www-data /var/www/subrion
4. Create Virtual Host
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.confconfiguration file.$ sudo a2dissite 000-default.confCreate a new
subrion.confconfiguration file.$ sudo nano /etc/apache2/sites-available/subrion.confPaste the information below into the new file. Replace
example.comwith 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.confto the list of enabled sites.$ sudo a2ensite subrion.confRestart the web server to load the new configurations.
$ sudo systemctl restart apache2
5. Test Subrion Installation
Visit the address
http://example.comin a web browser. Replaceexample.comwith 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.phpfile for security purposes.$ sudo rm /var/www/subrion/install/modules/module.install.php $ sudo chmod 400 /var/www/subrion/includes/config.inc.phpAppend
/panelto your server's public IP address or domain name to access the administration panel. For instance,http://example.com/panel.
Conclusion
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.