How to Install Concrete5 on CentOS 7

Published on: Fri, Feb 10, 2017 at 11:54 am EST
CentOS Server Apps System Admin Web Servers

Concrete5 is an open source CMS which offers many distinctive and useful features to assist editors in producing contents easily and quickly.

This article will cover the process of installing Concrete5 on a CentOS 7 server.

Prerequisites

  • A CentOS 7 x64 server instance.
  • A sudo user.

Step 1: Update the system

When logging in as a sudo user, you can update the system to the latest stable status as follows:

sudo yum install epel-release -y
sudo yum update -y
sudo shutdown -r now

Step 2: Install Apache

Deploying a Concrete5 website requires you to setup a web server. On CentOS 7, you can install the Apache web server using YUM:

sudo yum install httpd -y

Remove the Apache welcome page:

sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

Disable Apache’s public directory and file listing:

sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf

Start the Apache service and enable it on system boot:

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step 3: Install MariaDB 10

Another component that Concrete5 requires is database software. On CentOS 7, you can install MariaDB 10.x as follows in order to get better performance.

3.1 Create the MariaDB 10.1 YUM repo:

cat <<EOF | sudo tee -a /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2017-01-14 03:11 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

3.2 Install MariaDB 10.1 using YUM:

sudo yum install MariaDB-server MariaDB-client -y

3.3 Start the MariaDB service:

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

3.4 Secure the installation of MariaDB:

sudo /usr/bin/mysql_secure_installation

Reply to questions as below, and be sure to choose a strong MariaDB root password.

Enter current password for root (enter for none): Enter
Set root password? [Y/n]: Y
New password: <your-password>
Re-enter new password: <your-password>
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y

3.5 Setup a database for Concrete5:

Log into the MySQL shell as root:

mysql -u root -p

Type the MariaDB root password you set earlier and then press Enter in order to log in.

In the MySQL shell, create a database concrete5, a database user concrete5user, and its password yourpassword as follows.

Note: For security purposes, you should replace these sample parameters with your own ones.

CREATE DATABASE concrete5;
CREATE USER 'concrete5user'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON concrete5.* TO 'concrete5user'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

Step 4: Install PHP 7

As required by Concrete5, you can install PHP 7.1 and necessary PHP extensions using the Webtatic YUM repo:

sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
sudo yum install mod_php71w php71w-mysqlnd php71w-xml php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-cli php71w-xmlrpc -y

Step 5: Install Concrete5

Download the latest stable release of Concrete5 from its official download page.

cd
wget https://core-releases.s3.amazonaws.com/9314/8193/0256/concrete5-8.0.3.zip
sudo yum install unzip -y
unzip concrete5-8.0.3.zip
sudo mv concrete5-8.0.3 /var/www/html
sudo chown -R apache:apache /var/www/html

Setup an Apache virtual host for Concrete5:

cat <<EOF | sudo tee -a /etc/httpd/conf.d/concrete5.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/concrete5-8.0.3/
ServerName concrete5.example.com
ServerAlias www.concrete5.example.com
<Directory /var/www/html/concrete5-8.0.3/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/concrete5.example.com-error_log
CustomLog /var/log/httpd/concrete5.example.com-access_log common
</VirtualHost>
EOF

Restart Apache:

sudo systemctl restart httpd.service

Modify firewall rules to allow http connections:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Point your web browser to http://203.0.113.1, and then continue the installation.

On the Choose Language page, choose your favorite language and then click the Right Arrow button.

On the Testing Environment page, make sure that all requests are satisfied, and then click the Continue to Installation button.

On the Site Information page, input information as below, and then click the Install Concrete5 button:

Site:

  • Name: example.com
  • Administrator Email Address: admin@example.com
  • Administrator Password: <your-admin-password>
  • Confirm Password: <your-admin-password>

Start Point:

  • Decide to create a Empty Site or a Full Site.

Database:

  • Server: localhost
  • MySQL Username: concrete5user
  • MySQL Password: yourpassword
  • Database Name: concrete5

If nothing goes wrong, you will receive the Installation Complete message on the screen. Click the Edit Your Site button to start using Concrete5.

That concludes our tutorial. Thanks for reading.

Want to contribute ?

You could earn up to $300 by adding new articles