How to Install and Configure October CMS 2 on a Ubuntu 20.04 Server
October CMS 2 is a simple and reliable content management system with features like Twig templating, extendable functionality via Plugins, built-in image cropping and advanced file management. This guide explains how to install October CMS on a Ubuntu 20.04 LAMP server.
Prerequisites
Before starting this guide:
- Deploy a new Vultr Ubuntu 20.04 server instance
- Create a non-root sudo user
- Create a DNS "A" record with a fully-qualified domain name pointed to your server
- Purchase an October CMS license key
- Install a LAMP stack.
1. Edit Apache Configuration
Edit the Apache default site configuration file to make changes that will allow October CMS to run smoothly on your server.
Edit the file.
$ sudo nano /etc/apache2/sites-enabled/000-default.conf
Find the line:
DocumentRoot "/var/www/html"
Edit the document root entry to include the rules below.
<Directory /var/www/html/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
Save and close the file
Enable the
mod_rewrite
Apache module.$ sudo a2enmod rewrite
Enable and start Apache at boot time.
$ sudo systemctl enable apache2 $ sudo systemctl start apache2
Restart the service to reload the new changes.
$ sudo systemctl restart apache2
Verify Apache is running.
$ sudo systemctl status apache2
October CMS 2 requires PHP 7.2.9 or higher and several PHP extensions. To install PHP and all required extensions:
$ sudo apt -y install php php-ctype php-curl php-xml php-fileinfo php-gd php-json php-mbstring php-mysql php-sqlite3 php-zip libapache2-mod-php
2. Create an October CMS Database
Log in to MySQL as root and enter your password.
$ sudo mysql -u root -p
Create the October CMS database.
> CREATE DATABASE october_db CHARACTER SET utf8 COLLATE utf8_general_ci;
Create a new database user and assign it a strong password.
> CREATE USER 'october_user'@'localhost' IDENTIFIED BY 'YOUR_STRONG_PASSSWORD';
Grant the new user full rights to the October CMS database.
> GRANT ALL PRIVILEGES ON october_db.* TO 'october_user'@'localhost';
Refresh MySQL user privileges and exit.
> FLUSH PRIVILEGES; > EXIT;
Test that your newly created user has rights to the database.
$ mysql -u october_user - p
Enter the user password and display databases assigned to the user.
> SHOW DATABASES;
Enable MySQL server to start at boot time, and restart the service to apply changes.
$ sudo systemctl enable mysql $ sudo systemctl restart mysql
3. Install Composer
October CMS 2 uses Composer to manage its dependencies, the CMS does not have a direct installation candidate, and composer is used to download all necessary CMS files required to create projects.
To install Composer, re-update your system and install the Composer PHP extensions.
$ sudo apt update $ sudo apt install wget php-cli php-zip unzip curl
Download Composer
$ curl -sS https://getcomposer.org/installer | php
Move the downloaded file to
/usr/local/bin
to make it a system wide application on your server.$ sudo mv composer.phar /usr/local/bin/composer
Verify your installation and see the version.
$ composer
4. Install October CMS 2
Create a new October CMS project directory named
myexample
.$ composer create-project october/october myexample
Move the new project to Apache's web root.
$ sudo mv -R myexample/ /var/www/html/
Grant Apache permissions to October CMS.
$ sudo chown -R www-data:www-data /var/www/html/myexample/
Change the Apache 2 configuration to point to your October CMS Installation directory.
$ sudo nano /etc/apache2/sites-enabled/000-default.conf
Find this line:
DocumentRoot "/var/www/html/”
Change it to:
DocumentRoot "/var/www/html/myexample"
Save and exit the file.
Restart Apache.
$ sudo systemctl restart apache2
Change to the October CMS working directory.
$ cd /var/www/html/myexample
Run PHP Artisan.
$ sudo php artisan october:install
Choose your preferred October CMS language, English is the default.
Enter your domain name, then choose a custom access URL.
Application URL [http://localhost]: >
Select a custom backend URI for administration.
Backend URI [/backend]: >
Select MySQL database server.
Database Engine [SQLite]: [0] SQLite [1] MySQL [2] Postgres [3] SQL Server >
Use the default value of
127.0.0.1
for Database Host.Database Host [127.0.0.1]: >
Enter
3306
for database port.Database Port [3306] >
Enter your database name, user, and password.
Database Name [database]: > Database Login [root]: > Database Password []: >
Enter your October CMS license key.
License Key: >
Installation will continue.
When finished, migrate the database to initialise the tables.
$ sudo php artisan october:migrate
Complete your October CMS configuration from a web browser. Connect to the backend URL with your domain name or server's IP address. For example:
http://YOUR_SERVER_IP_ADDRESS/backend http://YOUR_DOMAIN/backend
Next Steps
- You must create a user account to access the administration area.
- If you receive a
connection not secure
prompt, install a free Let’s encrypt SSL certificate to access your October CMS Dashboard. - See the October CMS documentation for more information.