Thursday, December 26, 2024
Google search engine
HomeGuest BlogsInstall and Configure October CMS on CentOS Stream 8

Install and Configure October CMS on CentOS Stream 8

If you are at a crossroad, plagued with the decision to choose a content management system for your blog or site, which one would you pick? Have you ever heard of October CMS? If not, then you are about to know more about its offering in this guide.

Built from the ground up using Laravel as the foundation, October is a free, open-source, self-hosted Content Management System (CMS) and web platform. The developers of October found it hard to use existing systems and hence gave birth to October CMS whose sole purpose is to make your development workflow simple again as we are going to witness in this guide.

October will help you create, manage, and modify content on your website with simplicity and ease. For those of us who have never heard of October CMS, a brief introduction above will suffice to get yourself into the loop. And now that we are all reading from the same page, it will be prudent to get us October busy in CentOS 8.

“We often miss opportunity because it’s dressed in overalls and looks like work”
Thomas A. Edison

Before we start, check out the minimum system requirements that October CMS asks of us before we have it setup.

Minimum system requirements.

  • PHP version 7.0.8 or higher
  • PDO PHP Extension
  • cURL PHP Extension
  • OpenSSL PHP Extension
  • Mbstring PHP Library
  • Apache with mod_rewrite or Nginx
  • ZipArchive PHP Library
  • GD PHP Library

We are going to satisfy these requirements before we fetch October. And here we go.

Step 1: Prepare your Server

Jump into the terminal of your fresh CentOS 8 server, update it and install essential tools we shall use in our installation process.

sudo dnf update
sudo dnf -y install git unzip vim nginx

Disable SELinux

This is optional if you can handle SELinux with ease. To disable it, run the command below and reboot your server.

sudo sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
sudo setenforce 0

Step 2: Install PHP on CentOS 8

Let us get the PHP requirements above met by installing it in our server. Kindly follow How To Install PHP on CentOS 8 | RHEL 8 guide to get everything up and running fast.

Once your PHP 7 is well installed, add the following modules needed by October as illustrated below.

sudo yum install -y php-cli php-pdo php-common php-mysql php-curl php-json php-zip php-gd php-xml php-mbstring

Edit php-fpm file /etc/php-fpm.d/www.conf and set the user and group to nginx. They are usually set to apache by default.

$ sudo vim /etc/php-fpm.d/www.conf
user = nginx
group = nginx

Restart php-fpm after you have made those changes

sudo systemctl restart php-fpm

Step 3: Install and setup database

We are going to use MariaDB for this setup. Fortunately, we have a detailed guide already to get MariaDB 10.5 installed on CentOS 8. Check out Install MariaDB 10 on CentOS 8

After you have the database installed, the next step is to create a database and user for October CMS. Let us therefore go ahead and get this done as shown below. You are free to name your database and user differently and ensure you use a safe password.

$ sudo mysql -u root -p
CREATE DATABASE octoberdb;
GRANT ALL ON octoberdb.* TO 'octoberadmin' IDENTIFIED BY 'SafePassword';
FLUSH PRIVILEGES;
QUIT

Step 4: October CMS installation on CentOS 8

October can be installed either via the command-line or through a wizard that is provided. We are going to use the wizard/installer way in this guide because of its simplicity. Let us proceed.

Create a directory that we shall drop October files in. This will also help us in setting up the root directory that our web server will be looking into serve the files.

sudo mkdir /var/www/html-cms && cd /var/www/html-cms

Download October installer files and unzip them.

sudo wget http://octobercms.com/download -O october.zip
sudo unzip october.zip
sudo mv install-master/* .

The command above will unzip the files and lay them in our intended root directory, that is /var/www/html-cms.

Step 5: Configure webserver (Nginx)

Open Nginx configuration file and edit the server block to look like below. ENsure you place the right server_name and root directory depending on your environment.

$ sudo vim /etc/nginx/nginx.conf
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /var/www/html-cms/;
        server_name example.com;

        index index.php index.html;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
                try_files $uri /index.php$is_args$args;
        }
        location ~ \.php$ {
           fastcgi_pass unix:/run/php-fpm/www.sock;
           fastcgi_index index.php;
           fastcgi_read_timeout 240;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           include fastcgi_params;
               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;
    }

Modify the permissions on the root directory and restart the webserver

sudo chown -R nginx:nginx /var/www/html-cms
sudo systemctl restart nginx php-fpm

Modify firewall rules in order to allow port 80 or 443 as you wish:

sudo firewall-cmd --permanent --add-port={80,443}/tcp
sudo firewall-cmd --reload

Step 6: Setup October CMS

Navigate to http://[ip-address-or-domain-name]/install.php and follow the screenshots below to complete the installation.

On page One

The first page will do a system check to ensure everything has been met before it starts the installation. If everything is okay on this page, scroll down and click “Agree and Continue

October page 1 system check
October page 1 system check click agree and continue 1

Database details

The second page will present a form to you requesting for the database details we configured in Step 4. Fill the details accordingly then click on “Administrator” tab.

October page 2 database details input

Administrator

On this third page, you will specify the details for logging in to the Administration Area. Click “Continue” once done

October page 3 administrator details

Getting Started

If all goes well, we should now be ready to start a project on this page. You can either start from scratch, start with a theme, or use a pre-existing ID. Themes can install plugins and create pages needed to jump-start your website. We can start with a theme to make our work easier in this guide.

October page 4 getting started

Select the theme that catches thine eye and install it.

October page 5 start from a theme

This one arrested mine attention.

October page 6 start from a theme vanilla

Give it time to install.

October page 7 2 start from a theme vanilla installing
October page 7 start from a theme vanilla installing

Once it is done installing, it is time to get to work now. Click on the “Administration Area” link to so that we can edit the backend of the new site/blog.

October page 8 start from a theme vanilla installed

Enter the username and Password you configured

October page 9 start from a theme vanilla admin area

Once we are in, click on the “CMS” tab to start modifying your project.

October page 10 start from a theme vanilla dashboard

On the left pane, click on any Tab to modify its corresponding content. An example is shown below.

October page 11 start from a theme vanilla editing vanilla

You will notice that even though you can modify the theme directly, you are also given a code-editor within it so that you add custom lines of code as well as edit what is already given. This is amazing stuff by October CMS. And before you ask, yes you can preview the changes you have made by clicking on the top-right icon illustrated on the screenshot below as well.

October page 12 start from a theme vanilla editing vanilla and saving

And a sample preview is shown below.

October page 13 start from a theme vanilla preview

Step 7: Post-installation work

After the installation is complete, October team proposes a few things to be done especially if you intend to use it for production.

Delete installation files

Navigate to the directory where you placed the installation files and delete them for security reasons. These files are:

install_files/ <== Installation directory
install.php <== Installation script

cd /var/www/html-cms/
sudo rm -rf install_files install.php

Set up a scheduler

For scheduled tasks to operate correctly, you should add the following Cron entry to your server. Editing the crontab is commonly performed with the command crontab -e.

$ sudo crontab -e
* * * * * php /var/www/html-cms/artisan schedule:run >> /dev/null 2>&1

This Cron will call the command scheduler every minute. Then October evaluates any scheduled tasks and runs the tasks that are due.

Disable debug mode in production

While most configuration is optional, October developers strongly recommend disabling debug mode for production environments. When enabled, this setting will show detailed error messages when they occur along with other debugging features. To disable debug mode, open the config.app.php file and set debug from true to false:

$ sudo vim /var/www/html-cms/config/app.php
    'debug' => false,

Restart nginx after all the changes

In order for the webserver to pick the new changes made, restart it like

sudo systemctl restart nginx

For more about October CMS visit their official webpage and also check their documentation for other configuration details.

Conclusion

October CMS presents an easy to use platform that anyone can use without having to refer to the documentation that often. It makes it easy to set up a site from scratch or to leverage on pre-developed themes to speed up your project. Give it a try guys and check out of it will make a difference in your development work flow or projects. We hope it will be fun and bring freash air into your toolset.

People also read:

Install and Configure Drupal 9 CMS on CentOS 8

How To Install Drupal 9 CMS on Ubunt

Install and Configure Ghost CMS on CentOS 8 / RHEL 8

Install and Configure Drupal 9 on CentOS 7

Install October CMS on Ubuntu

RELATED ARTICLES

Most Popular

Recent Comments