October CMS is a free open-source self-hosted content management system based on Laravel PHP Framework. It is used in creating and managing website/ blog content in order to create dynamic websites and blogs. October CMS is meant to be a simple to use tool for content creatures. In this guide, we are going to look at how to install October CMS with Nginx on Oracle Linux 8.

Prepare your system for installation

Update your Oracle Linux packages first

sudo dnf update

I am going to first set SElinux in disabled mode before starting installations. Open SElinux configuration file and and change ‘SELINUX’ line to disabled then close and save the file.

$ sudo vim /etc/selinux/conf

Reboot your system after saving the file.

sudo reboot

Install October CMS dependencies

Install Epel and Remi repositories to use in installing required dependencies.

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm 
sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

Install PHP and other dependencies

We are going to install php7.4 and other php modules. Disable the default php7.2 that comes with Oracle Linux 8.

sudo dnf module reset php 
sudo dnf module install php:remi-7.4 

Install other required dependencies as below:

sudo dnf -y install php-fpm php-curl php-xml php-zip php-mysqlnd php-intl php-gd php-json php-ldap php-mbstring php-opcache mariadb mariadb-server nginx git unzip socat

Start and enable Nginx and php-fpm

We have already installed Nginx and php-fpm. We are going to start and enable them on system boot with the below commands:

sudo systemctl start nginx php-fpm
sudo systemctl enable nginx php-fpm

Create October CMS Database

Since we have already installed MariaDB, we are going to create a database to be used by October CMS. Let us go ahead to start and enable MariaDB
sudo systemctl start mariadb
sudo systemctl enable mariadb

Now secure MariaDB and set root password

$ mysql_secure_installation
Enter current password for root (enter for none): Just press Enter
Set root password? [Y/n] Y 
New password:  New-root-password
Re-enter new password: Re-enter New-root-password
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 
Thanks for using MariaDB!

Connect to mysql using the below command and the password set above.

mysql -u root -p

Once connected, create a database and user as shown below:

CREATE USER 'october'@'localhost' IDENTIFIED BY 'mypassword'; 
GRANT ALL PRIVILEGES ON october.* TO 'october'@'localhost'; 

Configure Nginx for October CMS

We are going to create a file, october.conf in nginx directory as shown below:

sudo vim /etc/nginx/conf.d/october.conf

Add the following content

server {
   listen [::]:80; 
   listen 80; 
   server_name october.example.com; 
   index index.php index.html; 
   root /var/www/october; 

   location / { 
       try_files $uri index.php$is_args$args; 
   location ~ \.php$ { 
       include fastcgi_params;
       fastcgi_index index.php; 
       fastcgi_pass unix:/run/php-fpm/php-fpm.sock 
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
       fastcgi_read_timeout 120s; 
       fastcgi_split_path_info ^(.+.php)(/.+)$;
   rewrite ^themes/.*/(layouts|pages|partials)/.*.htm /index.php break; 
   rewrite ^bootstrap/.* /index.php break; 
   rewrite ^config/.* /index.php break; 
   rewrite ^vendor/.* /index.php break; 
   rewrite ^storage/cms/.* /index.php break; 
   rewrite ^storage/logs/.* /index.php break; 
   rewrite ^storage/framework/.* /index.php break; 
   rewrite ^storage/temp/protected/.* /index.php break; 
   rewrite ^storage/app/uploads/protected/.* /index.php break; 

Test Nginx configuration

sudo nginx -t

You should get an output with ‘OK’ if nginx configuration has no errors. After that restart nginx

sudo systemctl restart nginx

Download and install October CMS

Make a directory for the installation of October CMS and update permissions

sudo mkdir -p /var/www/october
sudo chown -R nginx:nginx /var/www/october

Change to the created directory and download October CMS

cd /var/www/october
sudo wget http://octobercms.com/download -O october.zip

Unzip October CMS installer

sudo unzip october.zip 
rm october.zip 
sudo mv install-master/* .

Configure PHP-FPM for October CMS

In this file, we need to specify nginx user and group. They are normally set for apache but we are going to replace with nginx. You should have the following lines:

$ sudo vim /etc/php-fpm.d/www.conf
user = nginx
group = nginx
listen =/run/php-fpm/php-fpm.sock
listen.owner = nginx
listen.group = nginx
listen.mode =  0660

Save the file and restart php-fpm

sudo systemctl restart php-fpm

Once done access Joomla cms from the browser using your set username: http://october.example.com/install.php to finish up the installation process. You should get a page as below:

In this page, check if all requirements are met. At the bottom of the page, agree to license policy by clicking on Agree and Continue

The next page is for database configuration. Provide the required database information.

When done with Database information, click on Administrator on the bottom right to provide Admin information that will be used to access October CMS

You can click on Advanced if you wish to configure different file permissions. Otherwise click ‘continue’. The next page prompts you how you would like to start your new site. Once you chose, it will start install application files and creates admin user the finishes installation.

You can now access your October CMS on browser using the url http://october.example.com.

After the installation, for security reasons you should delete the installation files, the install.php script and the install_files directory:

sudo rm /var/www/october/install.php && sudo rm -rf /var/www/october/install_files

Enjoy your usage of October CMS on Oracle Linux 8. Below are more guides on content management systems:


Please enter your comment!
Please enter your name here