October CMS on OpenBSD

nabbisen - Oct 6 '19 - - Dev Community

Summary

October is a CMS platform based on PHP Laravel framework.

I was interested in it when I got to know it has core auto updates like WordPress.
Also, I had been interested in Laravel, which I had never used and read about those by the users saying it is great.

This post is about my installing it in OpenBSD, my favorite OS :)

Environments

  • OS: OpenBSD 6.5
  • Database: MariaDB 10.0
  • Web Server: OpenBSD httpd
  • App Server: PHP 7.3
  • CMS: October 1.0.459
    • based on Laravel: 5.5
    • requires PHP 7.0 or greater

The minimum system requirements is here.

Steps of installation

#1. Database

Database type options are MySQL, PostgreSQL, SQLite3 or MS SQL Server.
I use MariaDB, a nice folk of MySQL.

Create a database and a user with such statements:

CREATE DATABASE <database> CHARACTER SET = 'utf8mb4';
GRANT ALL PRIVILEGES ON <database>.* TO <dbuser> IDENTIFIED BY '<dbpass>';
FLUSH PRIVILEGES;
Enter fullscreen mode Exit fullscreen mode

#2. Application

First, prepare "php" executable, for php-7.3 isn't available on the way:

# ln -s /usr/local/bin/php-7.3 /usr/local/bin/php
Enter fullscreen mode Exit fullscreen mode

Prepare a directory:

$ mkdir <october-dir>
$ cd <october-dir>
Enter fullscreen mode Exit fullscreen mode

Get the modules:

$ curl -s https://octobercms.com/api/installer | php
$ # Alternatively, if `curl` isn't available:
$ # php -r "eval('?>'.file_get_contents('https://octobercms.com/api/installer'));"
Enter fullscreen mode Exit fullscreen mode

Soon, subdirectories are created:

$ ls # in <october-dir>
artisan    config     modules    server.php themes
bootstrap  index.php  plugins    storage    vendor
Enter fullscreen mode Exit fullscreen mode

Let's install via command lines according to the official tutorial.

* Note: If you prefer GUI to CLI, wizard web server is available. With wzard installation, don't forget to delete both install.php and install_files/ for security reasons.

In order to install October, use Laravel's Artisan:

$ php artisan october:install
Enter fullscreen mode Exit fullscreen mode

The installer will start:

.====================================================================.

 .d8888b.   .o8888b.   db  .d8888b.  d8888b. d88888b d8888b.  .d888b. 
.8P    Y8. d8P    Y8   88 .8P    Y8. 88  `8D 88'     88  `8D .8P , Y8.
88      88 8P      oooo88 88      88 88oooY' 88oooo  88oobY' 88  |  88
88      88 8b      ~~~~88 88      88 88~~~b. 88~~~~  88`8b   88  |/ 88
`8b    d8' Y8b    d8   88 `8b    d8' 88   8D 88.     88 `88. `8b | d8'
 `Y8888P'   `Y8888P'   YP  `Y8888P'  Y8888P' Y88888P 88   YD  `Y888P' 

`=========================== INSTALLATION ==========================='
Enter fullscreen mode Exit fullscreen mode

Configure database:

 Database type:
  [0] MySQL
  [1] Postgres
  [2] SQLite
  [3] SQL Server
 > 

 MySQL Host [localhost]:
 > 127.0.0.1

 MySQL Port [3306]:
 > 

 Database Name []:
 > <database>

 MySQL Login []:
 > <dbuser>

 MySQL Password []:
 > <dbpass>
Enter fullscreen mode Exit fullscreen mode

Set up the admin user:

Enter a new value, or press ENTER for the default

 First Name [Admin]:
 > 

 Last Name [Person]:
 > 

 Email Address [admin@domain.tld]:
 > 

 Admin Login [admin]:
 > 

 Admin Password [admin]:
 > 
Enter fullscreen mode Exit fullscreen mode

Confirm them:

 Is the information correct? (yes/no) [yes]:
 > 
Enter fullscreen mode Exit fullscreen mode

Enter server url:

 Application URL []:
 > https://<fqdn>
Enter fullscreen mode Exit fullscreen mode

How about advaned configuration?
I proceed in order to change the address of the backend, in a word, "administration":

 Configure advanced options? (yes/no) [no]:
 > yes
Enter fullscreen mode Exit fullscreen mode

Skip it:

Enter a new value of 32 characters, or press ENTER to use the generated key

 Application key []:
 > 

Application key [] set successfully.
Enter fullscreen mode Exit fullscreen mode

Edit the address of the backend:

 Backend URL [backend]:
 > 
Enter fullscreen mode Exit fullscreen mode

Skip them:

 File Permission Mask [777]:
 > 

 Folder Permission Mask [777]:
 > 

 Enable Debug Mode? (yes/no) [yes]:
 > 

 Install the October.Drivers plugin? (yes/no) [no]:
 > 

 Install the Rainlab.Builder plugin? (yes/no) [no]:
 > 
Enter fullscreen mode Exit fullscreen mode

Then the goal is almost there:

Migrating application and plugins...
System
 - Nothing to migrate.
Backend
 - Nothing to migrate.
Cms
 - Nothing to migrate.
October.Demo
- Nothing to update.
.=========================================.
                ,@@@@@@@,                  
        ,,,.   ,@@@@@@/@@,  .oo8888o.      
     ,&%%&%&&%,@@@@@/@@@@@@,8888\88/8o     
    ,%&\%&&%&&%,@@@\@@@/@@@88\88888/88'    
    %&&%&%&/%&&%@@\@@/ /@@@88888\88888'    
    %&&%/ %&%%&&@@\ V /@@' `88\8 `/88'     
    `&%\ ` /%&'    |.|        \ '|8'       
        |o|        | |         | |         
        |.|        | |         | |         
`========= INSTALLATION COMPLETE ========='
Enter fullscreen mode Exit fullscreen mode

You may want to make additional configuration by editing config/app.php or config/cms.php.

Well, verify files are writable for web user:

# # For example:
# chmod -R g+w .
Enter fullscreen mode Exit fullscreen mode

Finally, thank you and so long, "php" executable:

# rm /usr/local/bin/php
Enter fullscreen mode Exit fullscreen mode

#3. Web server

Edit conf:

# nvim /etc/httpd.conf
Enter fullscreen mode Exit fullscreen mode

like:

server "<fqdn>" {
        listen on $ext_addr tls port 443
        tls {
                certificate     "/etc/ssl/<fqdn>.fullchain.pem"
                key             "/etc/ssl/private/<fqdn>.key"
        }
        log {
                access  "<fqdn>-access.log"
                error   "<fqdn>-error.log"
        }

        root "/<october-dir>"
        directory index index.php

        location "/*.php" { 
                fastcgi socket "/run/php-fpm.sock"
        } 
        location "/*.php[/?]*" { 
                fastcgi socket "/run/php-fpm.sock"
        }
}
Enter fullscreen mode Exit fullscreen mode

Restart the daemon:

# rcctl restart httpd
Enter fullscreen mode Exit fullscreen mode

Conclusion

Screenshots

Frontend

https://<fqdn>/index.php:

frontend

Backend

https://<fqdn>/index.php/<backend>:

backend

They look cool :)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .