• Get In Touch
June 7, 2017

How to Install Monstra on Ubuntu 14.04

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

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.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]