Install eZ Publish Community Project on a CentOS 7 VPS with Nginx and PHP-FPM


install-ez-publish-community-project-on-a-centos-7-vps-with-nginx-and-php-fpmIn this tutorial, we will show you how to install eZ Publish Community edition on a CentOS 7 VPS with Nginx, MariaDB and PHP-FPM. eZ Publish Community edition is an open source enterprise PHP content management system build on top of Symfony framework. This guide should work on other Linux VPS systems as well but was tested and written for a CentOS7 VPS.  

Update the system and install necessary packages.

[email protected]:~# yum -y update
[email protected]:~# yum install wget

Install MariaDB and create a database.

To install MariaDB server run the following command:

[email protected]:~# yum install mariadb-server mariadb

To start the service and enable it at the boot time run:

[email protected]:~# systemctl start mariadb.service
[email protected]:~# systemctl enable mariadb.service

It is very important to secure your MariaDB server, run the following script before creating and populating the databases.

mysql_secure_installation

Once you are finished with the step above, login as a MariaDB root and create an new database and user:

[email protected]:~# mysql -uroot -p
MariaDB [(none)]>> create database ezpublish;
MariaDB [(none)]>> GRANT ALL PRIVILEGES ON ezpublish .* TO 'ezpublish '@'localhost' IDENTIFIED BY 'ezpublishPassword';
MariaDB [(none)]>> flush privileges;
MariaDB [(none)]>> \q;

Create a root directory for your web site and extract eZ Publish

[email protected]:~# mkdir -p /var/www/html/yourSite.com/
[email protected]:~# cd /var/www/html/yourSite.com/
[email protected]:~# wget http://share.ez.no/content/download/161942/957955/version/7/file/ezpublish5_community_project-2014.11.1-gpl-full.tar.bz2
[email protected]:~# tar -vxjf ezpublish5_community_project-2014.11.1-gpl-full.tar.bz2
[email protected]:~# mv ezpublish5_community_project-2014.11.1-gpl-full/* .
[email protected]:~# rm -rf ezpublish5_community_project-2014.11.1-gpl-full

Install and configure PHP and Nginx

Installing PHP and Nginx is pretty easy, just run the following command:

[email protected]:~# yum install nginx php-fpm php-cli php-mysqlnd php-mbstring php-gd php-curl php-pdo php-xml
[email protected]:~# systemctl start php-fpm.service
[email protected]:~# systemctl enable php-fpm.service
[email protected]:~# systemctl start nginx.service 
[email protected]:~# systemctl enable nginx.service

We need to make some changes in the php.ini, open the file and set the memory_limit to 256M and date.timezone to your timezone.

[email protected]:~# vim /etc/php.ini
memory_limit = 256M
date.timezone = America/Chicago

To change PHP-FPM to listen on a unix socket, open the default www pool

[email protected]:~# vim /etc/php-fpm.d/www.conf

and change from

listen = 127.0.0.1:9000

to

listen = /var/run/php-fpm/php-fpm.socket

and restart the service for changes to take effect

[email protected]:~# systemctl restart php-fpm

Create a php session directory and change the ownership to apache (the user under which PHP runs).

[email protected]:~# mkdir /var/lib/php/session
[email protected]:~# chown apache:apache /var/lib/php/session

Copy the /var/www/html/yourSite.com/doc/nginx/etc/nginx/ez_params.d directory in your /etc/nginx/ directory.

cp /var/www/html/yourSite.com/doc/nginx/etc/nginx/ez_params.d /etc/nginx/

Copy the example nginx configuration /var/www/html/yourSite.com/doc/nginx/etc/nginx/sites-available/mysite.com into /etc/nginx/sites-available/yoursite.com

cp /var/www/html/yourSite.com/doc/nginx/sites-available/mysite.com /etc/nginx/conf.d/yourSite.com.conf

and edit the nginx configuration file to suit your needs. Test the Nginx configuration and restart the server by running the following commands:

[email protected]:~# nginx -t

[email protected]:~#  systemctl restart nginx

Set the correct permissions

[email protected]:~# chown -R apache:apache /var/www/html/yourSite.com/

That’s it. Now open your browser, type the address and follow the installation wizard. For more information, please check out the official eZ Publish Community Project website.


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 set this up 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.

Tutorials
How to Speed Up Drupal Using Varnish on an Ubuntu 16.04 VPS
Tutorials
Install RocketChat on an Ubuntu 14.04 VPS
Tutorials
How to install Concrete5 on a CentOS 6 VPS
  • Xeeel

    XeeelXeeel

    Author Reply

    Hi

    ez_params.d at this location /var/www/html/yourSite.com/doc/nginx/etc/nginx/ez_params.d does not exist ! how create it ?

    Same problem with sites-available/mysite.com in the following command :
    cp /var/www/html/yourSite.com/doc/nginx/sites-available/mysite.com /etc/nginx/conf.d/yourSite.com.conf


    • admin

      adminadmin

      Author Reply

      Change ‘yourSite.com’ with your domain name and follow the instructions closely.


 
Free Migration to RoseHosting. Award Winning Linux VPS Hosting with Fully Managed Support. Coupon RHBLOG50 for 50% offOrder Now
+