Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to install Epesi with Nginx on Ubuntu 16.04

Tags: nginx epesi sudo

In this tutorial, we are going to provide you with step-by-step instructions on how to install Epesi 1.8.0 with Nginx on an Ubuntu VPS.
Epesi BIM (Business Information Manager) is a web CRM/ERP application written in PHP, licensed under MIT License. Epesi BIM can be used to manage and share business records flexibly and easily.


Let’s start with the installation.

Update OS packages:

Make sure your package list and the OS packages are up to date by running the following commands:

sudo apt-get update
sudo apt-get upgrade

To install the latest Nginx version from the official Nginx repository, edit the ‘/etc/apt/sources.list’ file:

sudo vi /etc/apt/sources.list

Add the following lines:

deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx

Add the Nginx GPG key:

wget http://nginx.org/packages/keys/nginx_signing.key
cat nginx_signing.key | apt-key add -

Stop and remove Apache service:

sudo service apache2 stop
sudo apt-get remove apache2

Install Nginx on your virtual server:

sudo apt-get update
sudo apt-get install nginx

Configure Nginx to start on boot:

sudo /lib/systemd/systemd-sysv-install enable nginx

Install PHP and enable PHP modules:

sudo apt-get install php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-imap php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-pspell php7.0-readline php7.0-xml php7.0-mcrypt php7.0-zip
sudo phpenmod mcrypt
sudo phpenmod imap

Then, start with the Epesi installation procedure.

Download Epesi

Get the latest version of Epesi available at ‘https://sourceforge.net/projects/epesi’. Download it to a directory of your virtual server and extract it using the following commands:

cd /opt/
wget https://sourceforge.net/projects/epesi/files/latest/download -O epesi.zip
unzip epesi.zip
mv epesi-*/ /var/www/html/epesi

Create a new Nginx configuration file and add the following virtual block for your domain name:

vi /etc/nginx/conf.d/your-domain.com.conf

Add the following lines:

server {
listen 80;
server_name your-domain.com;

root /var/www/html/epesi;
index index.php index.html;
access_log /var/log/nginx/your-domain.com-access.log;
error_log /var/log/nginx/your-domain.com-error.log;
charset en_us.UTF-8;

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

Do not forget to replace your-domain.com with your actual domain name. Then, delete the ‘default’ Nginx configuration file:

rm /etc/nginx/conf.d/default.conf

Open the ‘/etc/php/7.0/fpm/pool.d/www.conf’ PHP configuration file and change the ‘listen’ variable:

change:

listen = /run/php/php7.0-fpm.sock

to

listen = 127.0.0.1:9000

Edit the ‘/etc/php/7.0/fpm/php.ini’ PHP configuration file:

vi /etc/php/7.0/fpm/php.ini

Add/modify the following settings:

max_execution_time = 300
max_input_time = 300
memory_limit = -1
post_max_size = 32M
upload_max_filesize = 32M

The webserver user (www-data) needs to be able to write to files and directories inside the ‘/var/www/html/epesi’ directory, so it can easily be accomplished by executing the following command:

sudo chown www-data:www-data -R /var/www/html/epesi/

Test the nginx configuration:

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If test is successful, restart php7.0-fpm and Nginx services for the changes to take effect:

sudo service php7.0-fpm restart
sudo service nginx restart

Create new MySQL user and database:

Epesi requires a database to work as this is where data is saved, so create a new MySQL database on your server:

mysql -u root -p
mysql> create database epesidb;
mysql> GRANT ALL PRIVILEGES ON epesidb.* TO 'epesiuser'@'localhost' IDENTIFIED BY 'Y0UR-PASSW0RD';
mysql> flush privileges;
mysql> quit

Install Epesi

Edit the Epesi database.php file (/var/www/html/epesi/include/database.php) and replace:

require_once('libs/adodb/adodb-errorhandler.inc.php');
require_once('libs/adodb/adodb.inc.php');

to

require_once('/var/www/html/epesi/libs/adodb/adodb-errorhandler.inc.php');
require_once('/var/www/html/epesi/libs/adodb/adodb.inc.php');

To install Epesi, open http://your-domain.com/ using a web browser and follow the easy instructions:

Select a language, and on the next page enter database information:

Database server address: localhost
Database port: 3306
Database server user: epesi
Database server password: Y0UR-PASSW0RD
Database name: epesidb
Create new database: No

Click ‘Next’. Create an administrator user account and follow the on-screen instructions.

Log in to the administrator back-end and configure Epesi according to your needs.


That is it. The Epesi installation is now complete.


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.



This post first appeared on Virtual-Server.org Virtual Server, please read the originial post: here

Share the post

How to install Epesi with Nginx on Ubuntu 16.04

×

Subscribe to Virtual-server.org Virtual Server

Get updates delivered right to your inbox!

Thank you for your subscription

×