Install Composr CMS on Ubuntu 18.04 LTS

Composr is a free and open source CMS with advanced social, interactive and dynamic functionality. It is written in PHP language and uses MariaDB to store their data. It is a combination of a Web content management system and Online community software. There are lot's of features are available out of the box in the Composr:

Features

  • Supports images, videos, audio, and more.
  • Supports multiple display modes that display the contents of categories using tables and boxes.
  • Event reminders, RSS and Atom support.
  • Allows you to create your own galleries.

In this tutorial, I will show you how to install Composr CMS on an Ubuntu 18.04 LTS server.

Requirements

  • A server running Ubuntu 18.04..
  • A static IP address 192.168.0.104 is set up to your server.
  • A non-root user with sudo privileges.

Getting Started

Before starting, you will need to update your system with the latest version. You can do this by running the following command:

sudo apt-get update -y
sudo apt-get upgrade -y

Once your system is updated, restart the system to apply the changes.

Install LAMP Server

Next, you will need to install Apache, MariaDB, PHP and other PHP libraries to your server. You can install all of them by running the following command:

sudo apt-get install apache2 mariadb-server unzip wget php7.2 libapache2-mod-php7.2 php7.2-common php7.2-sqlite php7.2-curl php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip -y

Once all the packages are installed, you will need to modify PHP default config file:

sudo nano /etc/php/7.2/apache2/php.ini

Make the following changes:

memory_limit = 300M
upload_max_filesize = 200M
max_execution_time = 400
date.timezone = Asia/Kolkata

Save and close the file. Then, restart Apache and MariaDB service and enable them to start on boot time by running the following command:

sudo systemctl restart apache2
sudo systemctl restart mariadb
sudo systemctl enable apache2
sudo systemctl enable mariadb

Configure MariaDB Database

By default, MariaDB is not secured. So, you will need to secure it first. You can secure the MariaDB installation by running the following script:

sudo mysql_secure_installation

Answer all the questions as shown below:

    Enter current password for root (enter for none):
    Set root password? [Y/n]: N
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]:  Y
    Reload privilege tables now? [Y/n]:  Y

Once the MariaDB is secured, log in to MariaDB shell:

mysql -u root -p

Enter your root password and press Enter, then create a database and user with the following command:

MariaDB [(none)]> CREATE DATABASE composrdb;
MariaDB [(none)]> CREATE USER composr;

Next, grant privileges to the Composr database with the following command:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON composrdb.* TO 'composr'@'localhost' IDENTIFIED BY 'mypassword';

replace the word 'mypasdsword' in the above command with a secure password of your choice. Next, flush the privileges with the following command:

MariaDB [(none)]> FLUSH PRIVILEGES;

Next, exit from the MariaDB console with the following command:

MariaDB [(none)]> exit

Install Composr

First, you will need to download the latest version of Composr from their official website. You can download it with the following command:

cd /tmp
wget https://compo.sr/site/dload.php?id=519 -O composr.zip

Once the download is completed, extract the downloaded file to the Apache web root directory with the following command:

unzip composr.zip -d /var/www/html/composr

Next, give proper permissions with the following command:

sudo chown -R www-data:www-data /var/www/html/composr/
sudo chmod -R 755 /var/www/html/composr/

Next, create an Apache virtual host file for Composr using the following command:

sudo nano /etc/apache2/sites-available/composr.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/composr
     ServerName 192.168.0.104

     <Directory /var/www/html/composr/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/composr_error.log
     CustomLog ${APACHE_LOG_DIR}/composr_access.log combined

</VirtualHost>

Replace example.com with your own domain name in the above file. Then save and close the Apache vhost configuration file. Then, disable Apache default virtual host file and enable Composr virtual host file with the following command:

sudo a2dissite 000-default
sudo a2ensite composr

Next, enable Apache rewrite module and restart Apache service to apply the changes with the following command:

sudo a2enmod rewrite
sudo systemctl restart apache2

Access Composr

Composr is now installed and listening on port 80. It's time to access Composr web interface.

Open your web browser and type the URL http://192.168.0.104/install.php. Replace the IP address in the URL with your server IP or use the domain name that you have chosen for this website instead. You will be redirected to the following page:

Composr installer page

Select your language and click on the Proceed button. You should see the following page:

Accept the license

Accept the Composr license agreement and click on the I agree button. You should see the following page:

Select database server

Select your database server and click on the Proceed button. You should see the following page:

Enter database details

Database details - part 2

Here, provide your base url, master password, admin username, password, database, database username and password, then click on the Install Composr button. You should see the following page:

Composr Installation finished

Now, click on Configure my Composr first button. You will be redirected to the Composr login page:

Log into Composr

Provide your admin username and password. Then, click on the Log In button. You should see the Composr default dashboard in the following page:

Composr dashboard

Congratulations! you have successfully installed and configured Composr CMS on Ubuntu 18.04 server. You can now easily host your own website using Composr. Feel free to comments me if you have any question.

Share this page:

Suggested articles

0 Comment(s)

Add comment