Installing October CMS on Fedora 29 Using Nginx

October CMS is a robust, open-source, self-hosted CMS platform built on the Laravel PHP Framework. With its source code hosted on GitHub, October CMS is favored by many digital studios and freelancers worldwide for its simplicity, flexibility, and modern
design. In this tutorial, we’ll guide you through the installation of October CMS on a Fedora 29 system, using NGINX as the web server and MariaDB as the database server. You also have the option to secure your site with HTTPS using Let’s Encrypt certificates.

Requirements

Ensure your server meets these minimum requirements for hosting with October CMS:

  • PHP version 7.0 or greater
  • PHP PDO Extension
  • cURL PHP Extension
  • OpenSSL PHP Extension
  • Mbstring PHP Library
  • Zip PHP Library
  • GD PHP Library
  • XML PHP Extension
  • JSON PHP Extension
  • Apache with mod_rewrite or NGINX

Prerequisites

  • Fedora 29 system
  • A non-root user with sudo privileges

Initial Steps

Verify your Fedora system version:

cat /etc/fedora-release
# Fedora release 29 (Twenty Nine)

Configure the timezone:

timedatectl list-timezones
sudo timedatectl set-timezone 'Region/City'

Update operating system packages:

sudo dnf upgrade -y

Install essential packages:

sudo dnf install -y vim wget curl git socat unzip bash-completion

Step 1 – Install PHP

To install PHP and necessary extensions:

sudo dnf install -y php-cli php-fpm php-pdo php-common php-mysqlnd php-curl php-json php-zip php-gd php-xml php-mbstring

Verify PHP installation:

php --version

Start and enable the PHP-FPM service:

sudo systemctl start php-fpm.service
sudo systemctl enable php-fpm.service

Step 2 – Install MariaDB and Create a Database for October

Install MariaDB database server:

sudo dnf install -y mariadb-server

Verify MariaDB installation:

mysql --version

Start and enable MariaDB service:

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Run the security script:

mysql_secure_installation

Create a database and user for October:

mysql -u root -p
# Enter password
CREATE DATABASE octobercms;
GRANT ALL ON octobercms.* TO 'octoberuser' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Exit the MariaDB shell:

quit

Step 3 – Install Acme.sh and Obtain Let’s Encrypt Certificate (Optional)

To enhance security, you can set up an SSL certificate. Use the Acme.sh client:

        sudo mkdir /etc/letsencrypt
        git clone https://github.com/Neilpang/acme.sh.git
        cd acme.sh
        sudo ./acme.sh --install --home /etc/letsencrypt --accountemail your_email@example.com
        cd ~

Verify Acme.sh version:

/etc/letsencrypt/acme.sh --version

Acquire RSA and ECC/ECDSA certificates:

        # RSA 2048
        sudo /etc/letsencrypt/acme.sh --issue --standalone --home /etc/letsencrypt -d example.com --keylength 2048
        # ECDSA
        sudo /etc/letsencrypt/acme.sh --issue --standalone --home /etc/letsencrypt -d example.com --keylength ec-256

Step 4 – Install and Configure NGINX

Install NGINX:

sudo dnf install -y nginx

Verify NGINX installation:

nginx -v

Start and enable NGINX service:

sudo systemctl start nginx.service
sudo systemctl enable nginx.service

Create NGINX configuration for October:


server {
    listen [::]:443 ssl http2;
    listen 443 ssl http2;
    listen [::]:80;
    listen 80;

    server_name example.com;

    index index.php index.html;
    root /var/www/october;
    ssl_certificate /etc/letsencrypt/example.com/fullchain.cer;
    ssl_certificate_key /etc/letsencrypt/example.com/example.com.key;
    ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.cer;
    ssl_certificate_key /etc/letsencrypt/example.com_ecc/example.com.key;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ \.php$ {
        include default.d/php.conf;
        include fastcgi_params;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 120s;
    }

    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 the NGINX configuration:

sudo nginx -t

Reload NGINX:

sudo systemctl reload nginx.service

Step 5 – Download and Install October CMS

Create a document root directory:

sudo mkdir -p /var/www/october

Set ownership of the directory:

sudo chown -R [your_user]:[your_user] /var/www/october

Navigate to document root and download CMS:

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

Unzip the installer:

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

Set NGINX ownership of the CMS directory:

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

Edit PHP-FPM configuration:

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

Restart PHP-FPM:

sudo systemctl restart php-fpm.service

Finalize installation using your browser:

Visit http://example.com/install.php and follow the on-screen instructions.

Step 6 – Complete the October Setup

Ensure system checks are correct, then follow the setup wizard. Configure your database and admin user settings:

October CMS setup

Set up advanced settings or proceed with defaults, then select how you want to set up your site:

Getting Started with October CMS

To access the administration area, append /backend to your site URL.

For security, delete installation files:

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

Links

FAQs

1. Why should I use October CMS?

October CMS delivers a straightforward and flexible way to build websites, leveraging the Laravel framework which is a robust PHP foundation. It is perfect for developers looking for a simple but powerful tool.

2. Can I install October CMS on a different OS?

Yes, although this guide is specific to Fedora 29, October CMS can be set up on any system that meets the minimum requirements, including different Linux distributions, Windows, and macOS systems.

3. Is SSL necessary for October CMS?

While not strictly necessary, enabling SSL is a recommended security best practice to protect data in transit between your server and users.

4. What do I do if I encounter errors during installation?

Ensure that all dependencies are installed correctly and check your PHP and NGINX configurations. The October CMS and Laravel communities are excellent resources for additional help.