Monstra is a modern, lightweight content management systems that easy to install, use and upgrade.
Beside its simplicity, Monstra is fast and lightweight, optimiised in both frontend and backend by combining html, css and js files to reduce HTTP calls to your server.
Monstra is also mobile ready so it’s not only good on computer screen but also on smaller screen like mobile phones or tablets.
The user friendlyness of Monstra will make it easy for a non technical person easy to update and monitor their website.
It also provides a nice API so you can extend Monstra using plugins and themes.
We can also create multiple users including multiple administrators.
Last but not least, Monstra is SEO friendly and built with security in mind.
You can learn more about Monstra by visiting Monstra website.
Objective
In this tutorial we’ll learn how to install Monstra CMS on Ubuntu 14.04. We will also install and configure its prerequisites.
Prerequisites
We will install Monstra CMS on a fresh installation of Ubuntu Server 14.04. We also need these applications to be able to run Monstra CMS:
- Apache 2
- PHP 5.3+
Update Base System
Before we install Monstra CMS, let’s update the system to the latest update.
$ sudo apt-get update
$ sudo apt-get -y upgrade
Install Apache 2
After applying latest update to our base system, let’s start by installing Apache 2 and its required libraries.
$ sudo apt-get -y install apache2 apache2-bin apache2-data apache2-mpm-prefork libaio1 libapache2-mod-php5 libapr1 libaprutil1 libdbi-perl libhtml-template-perl libterm-readkey-perl libwrap0 ssl-cert tcpd
We can check the Apache 2 service status using command below:
sudo service apache2 status
* apache2 is running
We can also check whether Apache 2 is listening on which port using command below.
sudo netstat -naptu | grep apache
tcp6 0 0 :::80 :::* LISTEN 14873/apache2
Install PHP 5
The last component that we have to install before we can install monstra is PHP 5. We will install PHP 5 and several common PHP libraries.
$ sudo apt-get -y install php5-cli php5-common php5-json php5-readline
Restart the Apache 2 process so the changes will be applied.
$ sudo service apache2 restart
Install Monstra
All prerequisites are already installed. We’re ready to install monstra. The latest stable version of monstra is available Monstra CMS download page.
At the time of this writing, the latest stable version is version 3.0.4, let’s download monstra compressed file using wget.
$ wget -c https://bitbucket.org/Awilum/monstra/downloads/monstra-3.0.4.zip
Extract the downloaded file using unzip
. If your system don’t have unzip
yet, you can install unzip using command below:
$ sudo apt-get -y install unzip
Extract monstra using unzip
$ unzip monstra-3.0.4.zip
Move monstra-3.0.4
directory to Apache directory as monstra.
$ sudo mv monstra-3.0.4 /var/www/monstra
Change ownership of the monstra
directory to the www-data
user and group.
$ sudo chown -R www-data:www-data /var/www/monstra
The Monstra files are now ready, now let’s create Apache Virtual Host configuration to serve monstra.
Configure Apache Virtual Host for http Only
Create new apache configuration file on /etc/apache2/sites-available/monstra.conf
with contents below.
<VirtualHost *:80>
ServerName monstra.exampleserver.xyz
DocumentRoot /var/www/monstra
<Directory /var/www/monstra>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/monstra.exampleserver.xyz-error.log
CustomLog ${APACHE_LOG_DIR}/monstra.exampleserver.xyz-access.log combined
</VirtualHost>
Don’t forget to change monstra.exampleserver.xyz
above with the domain name that you use for your monstra installation.
Enable the site using the a2ensite
command.
$ sudo a2ensite monstra
Reload the apache2
process so it read the new virtualhost configuration:
$ sudo service apache2 reload
Monstra Installation Wizard
Open your Monstra URL and you will get the Monstra installation Wizard.
We should pass all requirements now. Click Continue
HP_NO_IMG/data/uploads/users/7f7a9c3b-7a2c-4e9b-b14c-034cfb27734e/131434668.png” alt=”” />
Enter site Name and URL, Adminstrator credentials, Choose Timezone and set email for administrator. Click Install
HP_NO_IMG/data/uploads/users/7f7a9c3b-7a2c-4e9b-b14c-034cfb27734e/1172418335.png” alt=”” />
Our Monstra site is ready.
HP_NO_IMG/data/uploads/users/7f7a9c3b-7a2c-4e9b-b14c-034cfb27734e/142119089.png” alt=”” />
Click Log In link on the menu.
HP_NO_IMG/data/uploads/users/7f7a9c3b-7a2c-4e9b-b14c-034cfb27734e/924831166.png” alt=”” />
Login using the administrator credential that we just created.
HP_NO_IMG/data/uploads/users/7f7a9c3b-7a2c-4e9b-b14c-034cfb27734e/572117278.png” alt=”” />
After a successful login we will go to Monstra dashboard where we can manage content and also themes and plugins for Monstra.
HP_NO_IMG/data/uploads/users/7f7a9c3b-7a2c-4e9b-b14c-034cfb27734e/1575340.png” alt=”” />
Configure https only site for monstra
Secure connection is now a requirement for web application. Last step that we will do in this tutorial is changing the connection to only use https.
We assume that you already have SSL certificate and private key.
Let’s create new apache virtual host configuration on /etc/apache2/sites-available/monstra-ssl.conf
with contents below.
Don’t forget to change:
ServerName
SSLCertificateFile
SSLCertificateChainFile
SSLCertificateKeyFile
<VirtualHost *:80>
ServerName monstra.exampleserver.xyz
Redirect permanent / https://monstra.exampleserver.xyz/
</VirtualHost>
<VirtualHost *:443>
ServerName monstra.exampleserver.xyz
DocumentRoot /var/www/monstra
<Directory /var/www/monstra>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/monstra.exampleserver.xyz-error.log
CustomLog ${APACHE_LOG_DIR}/monstra.exampleserver.xyz-access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/monstra.exampleserver.xyz.crt
SSLCertificateChainFile /etc/apache2/ssl/monstra.exampleserver.xyz.crt
SSLCertificateKeyFile /etc/apache2/ssl/monstra.exampleserver.xyz.key
Header always set Strict-Transport-Security "max-age=15768000"
</VirtualHost>
# intermediate configuration, tweak to your needs
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
SSLHonorCipherOrder on
We will also disable monstra
http only virtual host and enable the new virtual host config.
$ sudo a2dissite monstra
$ sudo a2ensite monstra-ssl
The new virtual host configuration need Apache mod_ssl
and mod_headers
modules. We need to enable those modules.
$ sudo a2enmod ssl
$ sudo a2enmod headers
Now, restart the Apache 2 service so it will reload its configuration. We need to restart instead of reload since we enabled a new module.
$ sudo service apache2 restart
We need to change one Monstra settings. Open storage/database/options.table.xml
file.
Find the line below.
<name>siteurl</name><value>http://monstra.exampleserver.xyz</value>
Replace http
with https
<name>siteurl</name><value>https://monstra.exampleserver.xyz</value>
We also need to change Gravatar URL to use https so we don’t have mixed contents warning.
Open plugins/box/users/users.plugin.php
Find line below:
return 'http://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?size='.$size;
Replace http
with https
.
return 'https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?size='.$size;
Summary
In this tutorial we learned how to install monstra on Ubuntu 14.04.
We installed all the prerequisites, created user and database on MySQL for Monstra CMS and also configuref Apache 2 virtual hosts to be able to serve monstra.
We also configure https settings for monstra so we run Monstra CMS securely.