How to install Kajona CMS on a CentOS 7 VPS

Kajona is an open source content management framework based on PHP. Using Kajona you can easily create and manage your own website in no time. Kajona is available in two packages, full and light packages.
There are fewer modules and elements installed in the light package.
In this tutorial we will use the full Kajona package on a CentOS 7 Cloud VPS with Apache, MariaDB and PHP. The installation is pretty fast and straightforward.

Log in to your server as user root and make sure that all OS packages are up to date by executing the following command

yum -y update

Install MariaDB database server on your Linux Cloud VPS.

yum install mariadb mariadb-server

Start the MariaDB database server and enable it to start on boot

systemctl start mariadb
systemctl enable mariadb

Run the ‘mysql_secure_installation’ script to secure the database server and set your MariaDB root password.
Log in to the MariaDB server using the ‘root’ user and create new database end user for Kajona.

mysql -u root -p
CREATE DATABASE kajona;
CREATE USER 'kajonauser'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON `kajona`.* TO 'kajonauser'@'localhost';
FLUSH PRIVILEGES;

Do not forget to replace ‘PASSWORD’ with an actual strong password.
Kajona does not require its own database, it can share the same database with other applications.
Next, we will install Apache web server

yum install httpd

Same as we did with MariaDB, start the Apache web server and add it to automatically start on the system start-up

systemctl start httpd
systemctl enable httpd

Kajona is PHP based application, so we need to install PHP among with few PHP modules

yum install php php-gd php-xml php-common

Download the latest stable release of Kajona (which currently is version 4.6) to your server:

wget https://github.com/kajona/kajonacms/archive/master.zip

Unpack the downloaded zip arvhive to the document root directory on your server and rename the Kajona directory

unzip master.zip -d /var/www/html/
mv /var/www/html/kajonacms-master/ /var/www/html/kajonacms

If you are not sure where is your document root directory you can use the following command to find out:

grep -i '^documentroot' /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"

Next, create a new Apache virtual host for your website. Create a new configuration file ‘/etc/httpd/conf.d/vhosts.conf’:

vim /etc/httpd/conf.d/vhosts.conf
and add the following content to it:
IncludeOptional vhosts.d/*.conf

Then, create a new configuration file for your website /etc/httpd/vhosts.d/yourdomain.com.conf:

vim /etc/httpd/vhosts.d/yourdomain.com.conf
and add the following virtual host directives:
<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/html/kajonacms"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/kajonacms-error_log"
CustomLog "/var/log/httpd/kajonacms-access_log" combined

<Directory "/var/www/html/kajonacms/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

and finally restart Apache for the changes to take effect:

systemctl restart httpd

Now, load Kajona’s web installed by accessing http://yourdomain.com in a web browser and follow the guide to complete the installation.

Of course you don’t have to do any of this if you use one of our Linux Cloud VPS Hosting services, in which case you can simply ask our expert Linux admins to install Kajona for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment