In this tutorial, we will show you how to install Subrion CMS on a Debian 8 VPS with Apache, PHP and MySQL installed on it. Subrion is a free content management system written in PHP that allows web developers to build websites for any purpose.
This tutorial was tested and written for a Debian 8 VPS, but it should work on any Linux distribution.
This install guide assumes that Apache, MySQL and PHP are already installed and configured on your virtual server. At the time of writing this tutorial, the latest stable version of Subrion CMS is 3.3.5 and it requires:
- PHP 5.x with the GD graphics library version 2.0.x+, XML, MySQLi and mbstring PHP extensions enabled;
- Apache Web Server >= 2.0 compiled with mod_rewrite module and with the following directives allowed: RewriteEngine, RewriteBase, RewriteCond and RewriteRule.;
- MySQL 4 or higher installed on your virtual server.
Let’s start with the installation. Download the latest version of Subrion CMS available at http://tools.subrion.org/get/ to the server and extract it using the following commands:
cd /opt wget http://tools.subrion.org/get/latest.zip mkdir -p /var/www/html/subrion unzip -o latest.zip -d /var/www/html/subrion/
Create a new MySQL database for Subrion to use and assign a user to it with full permissions:
mysql -u root -p mysql> CREATE DATABASE subriondb; mysql> GRANT ALL PRIVILEGES ON subriondb.* TO 'subrionuser'@'localhost' IDENTIFIED BY 'your-password' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; mysql> quit
Do not forget to replace ‘your-password’ with a strong password.
Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘subrion.conf’ on your virtual server:
Then, run the following command:
ln -s /etc/apache2/sites-available/subrion.conf /etc/apache2/sites-enabled/subrion.conf
Or, use the a2ensite to enable the ‘subrion.conf’ configuration in Apache:
sudo a2ensite subrion.conf
Edit the ‘subrion.conf’ configuration file:
and add the following lines to it:
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html/subrion/ ServerName yourdomain.com ServerAlias www.yourdomain.com <Directory /var/www/html/subrion/> Options FollowSymLinks AllowOverride All </Directory> ErrorLog /var/log/apache2/yourdomain.com-error_log CustomLog /var/log/apache2/yourdomain.com-access_log common </VirtualHost>
In order to enable file uploads and disable Magic Quotes GPC and Register Globals in PHP, edit the php.ini configuration file and add/modify the following lines:
file_uploads = On magic_quotes_gpc = Off register_globals = Off
Optionally, add/modify the following lines in php.ini:
memory_limit = 128M default_charset = "UTF-8" mbstring.func_overload = 0
Set the proper file permissions for the Apache web server to write to ‘includes/config.inc.php’ file and ‘tmp’, ‘uploads’, ‘plugins’ and ‘backup’ directories:
sudo chown -R www-data:www-data /var/www/html/subrion/
Enable the Apache2 rewrite module if it is not already done so:
sudo a2enmod rewrite
Restart the Apache web server for the changes to take effect:
service apache2 restart
Open your favorite web browser, navigate to http://yourdomain.com and follow the easy instructions. For security reason, make sure to remove the ‘install/modules/module.install.php’ file after installation:
Also, change the permissions of includes/config.inc.php file to unwritable:
chmod a-w /var/www/html/subrion/includes/config.inc.php
That is it. The Subrion CMS installation is now complete.
Of course you don’t have to do any of this if you use one of our Optimized Debian Hosting services, in which case you can simply ask our expert Linux admins to install Subrion CMS for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.