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.

root@vps:~# yum -y update
root@vps:~# yum install wget

Install MariaDB and create a database.

To install MariaDB server run the following command:

root@vps:~# yum install mariadb-server mariadb

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

root@vps:~# systemctl start mariadb.service
root@vps:~# 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:

root@vps:~# 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

root@vps:~# mkdir -p /var/www/html/yourSite.com/
root@vps:~# cd /var/www/html/yourSite.com/
root@vps:~# wget http://share.ez.no/content/download/161942/957955/version/7/file/ezpublish5_community_project-2014.11.1-gpl-full.tar.bz2
root@vps:~# tar -vxjf ezpublish5_community_project-2014.11.1-gpl-full.tar.bz2
root@vps:~# mv ezpublish5_community_project-2014.11.1-gpl-full/* .
root@vps:~# 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:

root@vps:~# yum install nginx php-fpm php-cli php-mysqlnd php-mbstring php-gd php-curl php-pdo php-xml
root@vps:~# systemctl start php-fpm.service
root@vps:~# systemctl enable php-fpm.service
root@vps:~# systemctl start nginx.service 
root@vps:~# 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.

root@vps:~# 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

root@vps:~# 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

root@vps:~# systemctl restart php-fpm

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

root@vps:~# mkdir /var/lib/php/session
root@vps:~# 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:

root@vps:~# nginx -t

root@vps:~#  systemctl restart nginx

Set the correct permissions

root@vps:~# 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.

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

  1. 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

    Reply

Leave a Comment