Concrete5 is an open source content management system that can be used to create and deploy websites on the Internet.
It is written in the PHP programming language and built from custom components such as Laravel and Symfony. It is designed for users with a minimum amount of technical skills. Concrete5 provides easy to use web interface to deploy complex content driven websites and easily manage their content and structure.
In this tutorial, we will explain how to install Concrete5 on an Ubuntu 16.04 server with Nginx, PHP-FPM and MySQL.
Requirements
- A server running Ubuntu-16.04 on your system.
- A non-root user with sudo privileges setup on your server.
- A static ip address 192.168.0.23 configured on your server.
Update the System
Before starting, it is recommended to update your system with the latest stable version.
You can do this by running the following command:
sudo apt-get update -y
sudo apt-get upgrade -y
Once your system is updated, you can proceed to install Nginx, PHP-FPM and MySQL.
Install LAMP
In order to run Concrete5, you will need to install Nginx, PHP-FPM and MySQL in your system.
You can install all of them by running the following command:
sudo apt-get install nginx php7.0-fpm mysql-server php7.0-mysql
Once installation is complete, restart the Nginx and MySQL service and enable them to start on boot by running the following command:
sudo systemctl start nginx
sudo systemctl start mysql
sudo systemctl enable nginx
sudo systemctl enable mysql
Next, you will also need to edit some PHP5-FPM configuration settings.
You can do this by editing /etc/php/7.0/cli/php.ini
file:
sudo nano /etc/php/7.0/cli/php.ini
Change the file as shown below:
post_max_size = 20M
upload_max_filesize = 20M
memory_limit = 128M
Save and close the file when you are finished, then restart Nginx and PHP5-FPM for the changes to take effect:
sudo systemctl restart nginx
sudo systemctl restart php7.0-fpm
Configure MySQL Database
By default MySQL installation is not secured, so you will need to secure it first.
You can secure it by running the mysql_secure_installation script.
sudo mysql_secure_installation
Answer all the questions as shown below:
Enter current password for root (enter for none):
Change the root password? [Y/n] n
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
Once MySQL is secured, login to MySQL console and create a database for the Concrete5:
mysql -u root -p
Enter your MySQL root password and hit enter. Once you are logged in to your database, you will need to create a database for Concrete5:
mysql> CREATE DATABASE concrete5;
Next, create a new database user and provide the appropriate privileges to your database user over the database you have created.
mysql> GRANT ALL PRIVILEGES ON concrete5.* TO 'concrete5'@'localhost' IDENTIFIED BY 'password';
Next, run the following command to immediately apply the changes on the database privileges:
mysql> FLUSH PRIVILEGES;
Next, exit from the Mysql with the following command:
mysql> exit;
Once your database is configured, you can proceed to the next step.
Download and Install Concrete5
You can download the latest version of the Concrete5 from http://www.concrete5.org/developers/downloads/.
You can run the following command to download the file to your server using wget:
wget --trust-server-names http://www.concrete5.org/download_file/-/view/58379/8497/ -O concrete5.zip
Once the download is completed, extract the downloaded archive with the following command:
unzip concrete5.zip
Next, move the extracted directory to /var/www/html/ with the following command:
sudo mv concrete5.6.2.1 /var/www/html/concrete5
Next, give proper permission to the concrete5 directory:
sudo chown -R www-data:www-data /var/www/html/concrete5
Configure Nginx for Concrete5
Next, you will need to create an Nginx server block for Concrete5. You can do this by creating concrete5.conf file inside /etc/nginx/sites-available/ directory:
sudo nano /etc/nginx/sites-available/concrete5.conf
Add the following lines:
server {
listen 80 ;
root /var/www/html/concrete5/;
index index.php index.html index.htm;
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
server_name example.com ;
access_log /var/log/nginx/concrete5/access.log;
error_log /var/log/nginx/concrete5/error.log;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm-www-data.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Save and close the file when you are finished.
Next, enable the Nginx server block by running the following command:
sudo ln -s /etc/nginx/sites-available/concrete5.conf /etc/nginx/sites-enabled/
Restart Nginx for the changes to take effect:
sudo systemctl restart nginx
Access Concrete5
Before accessing the Concrete5 web interface, you will need to allow port 80 through UFW firewall.
By default UFW is disabled on your system, so you need to enable it first. You can enable it with the following command:
sudo ufw enable
Once UFW firewall is enabled, you can allow port 80 by running the following command:
sudo ufw allow 80
You can now check the status of UFW firewall by running the following command:
sudo ufw status
Next, open your web browser and type the URL http://192.168.0.23, you should see the language selection page as below:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/245707556.png” alt=”” />
Choose English language then click on the Right Arrow button
, you should see the testing environment page as below:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/388650126.png” alt=”” />
Next, click on the Continue to Installation
button, you should see the site information page as below:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/846101254.png” alt=”” />
Next, enter all the required information then click on the Install concrete5
button. Once installation is complete, you should see the following page:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/540246884.png” alt=”” />
Next, click the Edit Your Site
button to start with Concrete5:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/162191737.png” alt=”” />
Finally you have seccessfully installed Concrete5 content management system on your server.
Conclusion
In this tutorial, we have learned how to install Concrete5 on Ubuntu 16.04 server. You can now easily create and deploy your website easily as per your requirements.