Install Cotonti CMS/CMF on a CentOS 7 VPS

k3cGeWI0 (1)Cotonti is open source, community driven content management system (CMS) and content management framework (CMF) powered by PHP and MySQL. In this article we will guide you through the process of installing Cotonti on a CentOS 7 VPS with Apache, PHP and MariaDB.

Log in to your Linux VPS as user root and make sure that all packages are up to date

yum -y update

Now, we will install MariaDB

yum install mariadb-server mariadb

Start MariaDB and add it to automatically start on system start-up

systemctl start mariadb.service
systemctl enable mariadb.service

Run the following command to secure your MariaDB server and set a new root password

mysql_secure_installation

Cotonti needs an MySQL database, so log in to the MySQL server with user root and create new database and user

mysql -u root -p
MariaDB [(none)]> CREATE DATABASE cotonti;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON cotonti.* TO 'cotontiuser'@'localhost' IDENTIFIED BY 'PASSWORD';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]>> \q;

Don’t forget to replace ‘PASSWORD’ with an actual password.

Now, we will install Apache web server

yum install httpd

Start the web server and enable it to start at boot

systemctl start httpd
systemctl enable httpd

Install PHP and a few PHP extensions

yum install php php-mysql php-gd php-mbstring php-common

Download the latest release of Cotonti to your server

wget https://github.com/Cotonti/Cotonti/archive/master.zip

Extract the downloaded archive to the document root directory on your server.

yum -y install unzip
unzip master.zip -d /var/www/html/
mv /var/www/html/Cotonti-master/ /var/www/html/cotoni

Copy the sample configuration file and change its permissions

cp /var/www/html/cotonti/datas/config-sample.php /var/www/html/cotonti/datas/config.php
chmod 666 /var/www/html/cotonti/datas/config.php

Change the ownership

chown -R apache:apache /var/www/html/cotonti/

Now, we will set up Apache virtual hosting directive for your Cotonti website.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS

Create a ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content

IncludeOptional vhosts.d/*.conf

and create a ‘/etc/httpd/vhosts.d’ directory where we will put all our virtual hosts.

mkdir /etc/httpd/vhosts.d

Create a virtual host for your Cotonti domain

vim /etc/httpd/vhosts.d/yourdomain.conf

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/cotonti"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

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

And restart Apache for the changes to take effect

systemctl restart httpd

That’s all. Now, we need to lunch the web installer accessing http://yourdomain.com . The installation wizard will check if your server meets all the requirements, and will finish the Cotonti installation. You will need to enter your MySQL information and create administrator user.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this 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