Install Cotonti CMS/CMF on a CentOS 7 VPS
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
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
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.
Create a ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content
and create a ‘/etc/httpd/vhosts.d’ directory where we will put all our virtual hosts.
Create a virtual host for your Cotonti domain
vim /etc/httpd/vhosts.d/yourdomain.conf <VirtualHost YOUR_SERVER_IP:80> ServerAdmin [email protected] 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.