October is a free open-source content management system (CMS) which is based on PHP Laravel web application framework. The October CMS an extensive range of capabilities like users, plugins, permissions. It is currently the most starred PHP CMS repository hosted on GitHub.
You don't have to own any special kind of hardware or something to install October CMS. All you'll need is a CentOS server and a root or sudo user to access the server. In this guide we will use root user, You can switch to root user anytime you want using
Installing October CMS
Before installing any package on your system it is recommended to update the system and available packages. Run the following command to do so.
yum -y update
Once the system is updated, you can install the dependencies required. To install October CMS you will need to install the Apache web server along with MySQL and PHP with a few extensions.
Run the following command to install the Apache web server.
yum -y install httpd
Now you can start Apache and enable it to start at boot time, using the following commands.
systemctl start httpd.service systemctl enable httpd.service
You can check the status of Apache web server using the following command.
systemctl status httpd
You should see following output:
● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2017-01-04 04:05:26 UTC; 2min 8s ago Docs: man:httpd(8) man:apachectl(8) Main PID: 387 (httpd) Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service ├─387 /usr/sbin/httpd -DFOREGROUND ├─388 /usr/sbin/httpd -DFOREGROUND ├─389 /usr/sbin/httpd -DFOREGROUND ├─390 /usr/sbin/httpd -DFOREGROUND ├─391 /usr/sbin/httpd -DFOREGROUND └─392 /usr/sbin/httpd -DFOREGROUND
Jan 04 04:05:26 ip-172-31-23-61 systemd: Starting The Apache HTTP Server... Jan 04 04:05:26 ip-172-31-23-61 systemd: Started The Apache HTTP Server. [root@ip-172-31-23-61 ~]#
To install MySQL, you will need to add the MySQL yum repository to your system, run the following command to do so.
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
Once the repository is added, run the following command to install MySQL community server.
yum -y install mysql-community-server
Now you can start MySQL server and enable it to start at boot time like we have done before for Apache web server, using the following commands.
systemctl start mysqld systemctl enable mysqld
You can check the status of MySQL using the following command.
systemctl status mysqld
You should see following result on your screen:
[root@ip-172-31-23-61 ~]# systemctl start mysqld.service [root@ip-172-31-23-61 ~]# systemctl enable mysqld.service [root@ip-172-31-23-61 ~]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2017-01-04 04:10:32 UTC; 55s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Main PID: 589 (mysqld) CGroup: /system.slice/mysqld.service └─589 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
Jan 04 04:10:26 ip-172-31-23-61 systemd: Starting MySQL Server... Jan 04 04:10:32 ip-172-31-23-61 systemd: Started MySQL Server.
During installation of MySQL, the installer automatically uses a random password for the MySQL root user, you can obtain the password using the following command.
grep 'temporary password' /var/log/mysqld.log
You will see the following output containing the current root password.
[root@ip-172-31-23-61 ~]# grep 'temporary password' /var/log/mysqld.log 2017-01-04T04:10:29.566343Z 1 [Note] A temporary password is generated for root@localhost: o=_Rl!P(c6jk [root@ip-172-31-23-61 ~]#
Now you can run the following command to harden the security of your MySQL server.
You will be asked about your current root password, enter the password obtained through the command above. Now it will prompt to change your root password, and provide y for all the questions asked.
After installation of MySQL you will need to install the PHP programming language. October CMS recommendeds PHP version 5.6 or 7. The default CentOS 7 repository contains PHP 5.4, thus you will need to add webtatic repository in your server. To install webtatic repository, you will need to add EPEL repository also.
wget https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh epel-release.rpm
wget https://mirror.webtatic.com/yum/el7/webtatic-release.rpm rpm -Uvh webtatic-release.rpm
Now you can install any of the PHP versions. To install PHP v5.6 with required extensions, run the following command.
yum -y install php56w php56w-mysql php56w-dom php56w-xml php56w-gd php56w-fileinfo php56w-curl php56w-mcrypt php56w-zip php56w-mbstring
To install PHP 7.0 with the required extensions, run the following command.
yum -y install php70w php70w-mysql php70w-dom php70w-xml php70w-gd php70w-fileinfo php70w-curl php70w-mcrypt php70w-zip php70w-mbstring
Once done you can check the PHP version using the following command.
You should see following output.
[root@ip-172-31-23-61 ~]# php -v PHP 5.6.29 (cli) (built: Dec 10 2016 12:42:43) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies [root@ip-172-31-23-61 ~]#
To increase PHP memory limit, edit the /etc/php.ini file with your favorite text editor.
Scroll down to find the following lines.
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 128M
Increase the memory_limit according to the memory available on your system.
Now you will need to restart Apache web server in order use PHP with Apache, run the following command to do so.
systemctl restart httpd
Now you will have to create the the database required to store the October CMS data. Login to MySQL shell using the following command and providing the required password when prompted.
mysql -u root -p
Now execute the following query to create a new database.
CREATE DATABASE october_data;
The above query will create a database named october_data. For the database you can use any name you prefer in the place of october_data. Make sure that you use semicolon at the end of each query as a MySQL query always ends with a semicolon. Once the database is created you can create a new user and grant the required permissions to the user for the database.
CREATE USER 'october_user'@'localhost' IDENTIFIED BY 'StrongPassword';
The above query will create a user with username october_user. You can use any preferred username instead of october_user. Replace StrongPassword with a strong password.
Now provide the appropriate privileges to your database user over the database you have created. Run the following query to do so.
GRANT ALL PRIVILEGES ON october_data.* TO 'october_user'@'localhost';
Now run the following query to immediately apply the changes on the database privileges.
Now you can exit from MySQL prompt using following command.
Downloading October CMS
Now you'll need to download latest version of October CMS available on official website October CMS download page to any directory you wish on your server system using following commands shown below:
Now you are in /opt/ directory so let's download October CMS using following commands.
wget http://octobercms.com/download -O octobercms.zip
If in case you don't have wget command installed on your system then you'll have to install it first using
yum install wget.
We have downloaded October CMS on our system successfully now we will have to unzip this downloaded file to use because it is in zip format, To do so run following command:
unzip octobercms.zip -d /var/www/html/octobercms/If in case you don't have unzip installed on your system then you can install it using
yum install unzip.
You'll have to move the files of octobercms into the /var/www/html directory and to do so run following commands as shown below:
mv octobercms/* .
Now we will need to change the proper ownership. To do so run following command:
chown apache:apache -R /var/www/html/
Now disable SELinux temporarily and to do so run following command:
Restart your Apche web server using following command as shown below:
systemctl restart httpd
Now open your favorite web browser and go to the following link http://yourserverIP/install-master/install.php and follow instruction to complete the installation process.
You should see this page on your screen:
Click on Agree and Continue button to process further installation process.
In the next step you'll see a page like this so please provide required entries and finally click on Administrator button shown in right corner at bottom of the page.
By clicking on Administrator you'll see a page like this so please enter the admin details like shown below:
After completion now finally click on Continue button to complete the installation process and you'll see a web page like this on completion of installation process.
If you want to install October CMS without any plugins or themes, click on Start from scratch. But we recommend you to click on Start from a theme, select a theme and click ‘Install’. You can easily customize it later via admin back-end.
Now you have successfully installed October CMS on your CentOS 7 server.
In this tutorial you learned how to install October CMS on a CentOS 7 server and after this guide we hope now you have enough knowledge to work with October CMS.