How to install Craft CMS on CentOS 7
To install Craft CMS on CentOS 7
Craft - content management system (CMS) is a PHP based application built on Yii framework and it is used by publishers who want more control and more powerful performance from their CMS. It is built with several features and in this article, you will learn about the method to install Craft CMS on CentOS 7.
Pre-requirements
Install LAMP (apache, php, mariadb)
In mariadb (create database , user and give privileges to user)
Php modules (php php-pdo php-common php-mcrypt php-mbstring php-gd php-curl php-mysql)
Craft CMS
In order to download the installation package of Craft CMS, you ought to run the wget command followed by the download link.
[root@linuxhelp1 html]# wget https://download.craftcdn.com/craft/2.6/2.6.2993/Craft-2.6.2993.zip
--2017-10-25 09:49:58-- https://download.craftcdn.com/craft/2.6/2.6.2993/Craft-2.6.2993.zip
Resolving download.craftcdn.com (download.craftcdn.com)... 151.139.107.16
Connecting to download.craftcdn.com (download.craftcdn.com)|151.139.107.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16915928 (16M) [application/zip]
Saving to: ‘ Craft-2.6.2993.zip’
100%[======================================> ] 1,69,15,928 1.01MB/s in 17s
2017-10-25 09:50:16 (977 KB/s) - ‘ Craft-2.6.2993.zip’ saved [16915928/16915928]
Once the file is downloaded, you need to extract the downloaded file, this action can be done with the help of following command.
[root@linuxhelp1 html]# unzip Craft-2.6.2993.zip
Archive: Craft-2.6.2993.zip
inflating: craft/app/widgets/RecentEntriesWidget.php
inflating: craft/app/widgets/UpdatesWidget.php
inflating: craft/app/widgets/QuickPostWidget.php
inflating: craft/app/widgets/NewUsersWidget.php
inflating: craft/app/widgets/IWidget.php
inflating: craft/app/widgets/BaseWidget.php
inflating: craft/app/widgets/GetHelpWidget.php
inflating: craft/app/widgets/FeedWidget.php
inflating: craft/app/validators/DateTimeValidator.php
inflating: craft/app/validators/UrlValidator.php
.
.
inflating: readme.txt
inflating: public/robots.txt
inflating: public/web.config
inflating: public/htaccess
inflating: public/index.php
Later, you shall list the directory in which the file is present.
[root@linuxhelp1 html]# ls -l
total 16524
drwxr-xr-x 7 root root 113 Oct 25 10:29 craft
-rw-r--r-- 1 root root 16915928 Oct 18 23:51 Craft-2.6.2993.zip
drwxr-xr-x 2 root root 75 Oct 25 10:29 public
-rw-rw-rw- 1 root root 613 Apr 11 2017 readme.txt
Get into the craft directory.
[root@linuxhelp1 html]# cd craft/
In there, you need to edit the PHP file for adding database details.
[root@linuxhelp1 craft]# vim config/db.php
Edit following
' server' => ' localhost' ,
' user' => ' craftuser' ,
' password' => ' PASSWORD' ,
' database' => ' craft' ,
' tablePrefix' => ' craft' ,
Once it is done, you need to rename the htaccess file.
[root@linuxhelp1 craft]# cd ..
[root@linuxhelp1 html]# mv public/htaccess public/.htaccess
And then, you must create a VirtualHost configuration file for Craft CMS.
[root@linuxhelp1 html]# vim /etc/httpd/conf.d/craft.conf
Once the file is created, you must add the following files in it.
< VirtualHost *:80> ServerAdmin webmaster@craft.abc DocumentRoot " /var/www/html/public/" ServerName craft.abc ServerAlias www.craft.abc ErrorLog " /var/log/httpd/craft.abc-error_log" CustomLog " /var/log/httpd/craft.abc-access_log" combined < Directory " /var/www/html/public/" > DirectoryIndex index.html index.php Options FollowSymLinks AllowOverride All Require all granted < /Directory> < /VirtualHost>
Save and exit the file after the configuration.
After that, you should change the ownership and permission of file in HTML location as follows.
[root@linuxhelp1 html]# chown -R apache.apache /var/www/html/
[root@linuxhelp1 html]# chmod -R 775 /var/www/html/
Once it is done, you should restart the Apache service as follows.
[root@linuxhelp1 html]# systemctl restart httpd.service
Now let us proceed with the installation process via GUI, so, open your browser and give URL as craft.abc/index.php/admin/install, the installlation module of Craft CMS appears on your screen. Click on Begin button.

In the page that appears, enter the details for admin privileges and click Next.

Once it is done, configure your site details and click on Finish up.

The installation process of Craft CMS is now in progress.

Once you are through with the process, click on Go to Craft CMS for launching the application.

The Dashboard of Craft CMS appears on your screen.

With this, the installation of Craft CMS comes to an end.
Comments ( 0 )
No comments available