OctoberCMS is a free and open source Content Management System (CMS) and web platform based on the PHP programming language and Laravel web application. It is simple, fast and modular that allows you to create powerful and dynamic content websites. OctoberCMS allows you to blogs or websites without having any prior knowledge about coding from scratch in a graphical way similar to other CMS software. OctoberCMS is an ideal tool for web artisan or a small-to-medium digital studio. OctoberCMS has an extensive range of capabilities such as users, permissions, themes, and plugins.
In this tutorial, we will be going to explain how to install OctoberCMS on Ubuntu 18.04 server.
- A server running Ubuntu 18.04.
- A static IP address 18.104.22.168 is set up on your server.
- A root password is set up on your server.
Before starting, you will need to update your system with the latest version. You can do this by running the following command:
apt-get update -y
apt-get upgrade -y
Once your server is updated, restart your server to apply the changes.
Install Apache, MariaDB, and PHP
First, you will need to install Apache web server, MariaDB database server, PHP and other PHP modules to your system. You can install all of them by running the following command:
apt-get install apache2 mariadb-server php7.2 libapache2-mod-php7.2 libapache2-mod-php7.2 php7.2-json php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-tidy php7.2-mysql php7.2-cli php7.2-ldap php7.2-pdo php7.2-zip php7.2-curl php7.2-sqlite3 unzip wget -y
Once all the packages are installed, open the php.ini file to make some changes:
Make the following changes:
file_uploads = On allow_url_fopen = On memory_limit = 256M upload_max_filesize = 30M post_max_size = 40M max_execution_time = 60 max_input_vars = 1500
Save and close the file. Then, start Apache and MariaDB service and enable them to start on boot time with the following command:
systemctl start apache2
systemctl start mariadb
systemctl enable apache2
systemctl enable mariadb
By default, MariaDB is not secured. So, you will need to secure it. You can do this by running the mysql_secure_installation script:
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 with the following command:
mysql -u root -p
Enter your root password when prompt. Then, create a database and user for OctoberCMS using the following command:
MariaDB [(none)]> CREATE DATABASE octoberdb;
MariaDB [(none)]> CREATE USER 'october'@'localhost' IDENTIFIED BY 'password';
Next, grant all the privileges to octoberdb database with the following command:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON octoberdb.* TO 'october'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Next, flush the privileges and exit from the MariaDB shell with the following command:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
First, you will need to download the latest version of OctoberCMS from Git repository. You can download it with the following command:
wget https://codeload.github.com/octobercms/install/zip/master -O octobercms.zip
Once the download is completed, unzip the downloaded file with the following command:
Next, move the extracted directory to the Apache web root directory with the following command:
mv install-master /var/www/html/octobercms
Next, give proper permissions to the octobercms directory with the following command:
chown -R www-data:www-data /var/www/html/octobercms
chmod -R 755 /var/www/html/octobercms
Configure Apache for OctoberCMS
First, you will need to create an apache virtual host file for OctoberCMS. You can do it with the following command:
Add the following lines:
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org ServerName 192.168.0.103 DocumentRoot /var/www/html/octobercms/ <Directory /var/www/html/octobercms/> Options +FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog /var/log/apache2/october_error.log CustomLog /var/log/apache2/october_access.log combined </VirtualHost>
Save and close the file. Then, disable the Apache default virtual host file and enable OctoberCMS virtual host file with the following command:
Next, enable Apache rewrite module and restart the Apache service with the following command:
systemctl restart apache2
Next, check the status of Apache service with the following command:
systemctl status apache2
You should see the following output:
? apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Drop-In: /lib/systemd/system/apache2.service.d ??apache2-systemd.conf Active: active (running) since Wed 2019-01-30 10:56:45 UTC; 6s ago Process: 6498 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 6517 (apache2) Tasks: 1 (limit: 1114) CGroup: /system.slice/apache2.service ??6517 /usr/sbin/apache2 -k start Jan 30 10:56:45 ubuntu1804 systemd: Starting The Apache HTTP Server... Jan 30 10:56:45 ubuntu1804 apachectl: AH00557: apache2: apr_sockaddr_info_get() failed for ubuntu1804 Jan 30 10:56:45 ubuntu1804 apachectl: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. S Jan 30 10:56:45 ubuntu1804 systemd: Started The Apache HTTP Server.
Open your web browser and type the URL http://22.214.171.124/install.php.