How to Install EspoCRM-4.5.1 on Ubuntu-16.04

To Install EspoCRM-4.5.1 on Ubuntu-16.04

EspoCRM is an open source web application that allows people to enter, see and evaluate all company relationships including people, projects and opportunities in an easy and intuitive interface. EspoCRM is used by more than 20,000 companies in 163 countries. It can be used in any industry from Wholesale and retail trade, E-Commerce, Banking to Healthcare and Insurance. Apart from this, EspoCRM-4.5.1 comes with various other features and a few of them are listed here.


Features

  • Web based CRM. One version for all your devices.
  • Free of charge and open source CRM distributed under GPLv3.
  • Tested with most hosting providers.
  • New features every 2 months.
  • Responsive Design and latest Web Technologies.
  • Lightning fast.
  • No user limitation.


Installing EspoCRM

First, make sure you update the system with the help of the following command.

root@linuxhelp1:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]   
.
.
Get:15 http://in.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [4,696 B]
Fetched 1,593 kB in 4s (333 kB/s)              
AppStream cache update completed, but some metadata was ignored due to errors.
Reading package lists... Done

And then, install apache2 with requisites in the following command.

root@linuxhelp1:~# apt-get install apache2 apache2-bin apache2-data libaio1 libapr1 libaprutil1  libdbi-perl libhtml-template-perl libterm-readkey-perl libwrap0 ssl-cert tcpdReading package lists... Done
Building dependency tree       
Reading state information... Done
libwrap0 is already the newest version (7.6.q-25).
.
.
Setting up libhtml-template-perl (2.95-2) ...
Setting up libterm-readkey-perl (2.33-1build1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for ufw (0.35-0ubuntu2) ...

Also, check the status of apache2 with the help of the following command.

root@linuxhelp1:~# systemctl status apache2
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2  bad  vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Mon 2018-02-26 17:02:18 IST  13s ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/apache2.service
           ├─9160 /usr/sbin/apache2 -k start
           ├─9163 /usr/sbin/apache2 -k start
           └─9164 /usr/sbin/apache2 -k start

Then, you need to install MariaDB server by making use of the following command.

root@linuxhelp1:~# apt-get install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
.
.
Setting up mariadb-server-10.0 (10.0.33-0ubuntu0.16.04.1) ...
Setting up mariadb-server (10.0.33-0ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...

After that, check the status of MySQL.

root@linuxhelp1:~# systemctl status mysql
● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql  bad  vendor preset: enabled)
   Active: active (running) since Mon 2018-02-26 17:03:40 IST  11s ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/mysql.service
           ├─12090 /bin/bash /usr/bin/mysqld_safe
           ├─12234 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/l

Now proceed with the secure installation of MySQL server.

root@linuxhelp1:~# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we' ll need the current
password for the root user.  If you' ve just installed MariaDB, and
you haven' t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
[..]
Just press enter
[..]
Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

.
.
[..]
 And so on &hellip press y 
[..]

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you' ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

And then, log in to MySQL and make the following modifications.

root@linuxhelp1:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 51
Server version: 10.0.33-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Create Database
MariaDB [(none)]>  CREATE DATABASE espodb 
Query OK, 1 row affected (0.00 sec)

To give privilege for certain user
MariaDB [(none)]>  GRANT ALL PRIVILEGES ON espodb.* TO ' espouser' @' localhost'  IDENTIFIED BY ' 123'  
Query OK, 0 rows affected (0.00 sec)

To Flush privileges
MariaDB [(none)]>  FLUSH PRIVILEGES 
Query OK, 0 rows affected (0.02 sec)

To exit from database
MariaDB [(none)]>  EXIT
Bye

And then, you need to install PHP with requisites as follows.

root@linuxhelp1:~# apt-get -y install php-cli php-common php-json php-mysql php-readline php-gd php-curl php-imap libapache2-mod-php
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
.
.

Creating config file /etc/php/7.0/mods-available/imap.ini with new version
Setting up php-imap (1:7.0+35ubuntu6.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for libapache2-mod-php7.0 (7.0.25-0ubuntu0.16.04.1) ...

And then, you need to change value of php configuration as follows.

[..] max_execution_time to max_input_time to 180 memory_limit to 256M post_max_size to 20M upload_max_filesize to 20M [..] 

Then, you need to enable mode of imap.

root@linuxhelp1:~# phpenmod imap

And then, enable mode of rewrite.

root@linuxhelp1:~# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart

You should now restart your apache2 service.

root@linuxhelp1:~# systemctl restart apache2

And now, you need to download Espocrm.

root@linuxhelp1:~# wget -c https://www.espocrm.com/downloads/EspoCRM-4.5.1.zip
 --2018-02-26 17:09:36-- https://www.espocrm.com/downloads/EspoCRM-4.5.1.zip Resolving www.espocrm.com (www.espocrm.com)...
159.203.138.21 Connecting to www.espocrm.com (www.espocrm.com)
|159.203.138.21|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 25926528 (25M) [application/zip]
Saving to: ‘ EspoCRM-4.5.1.zip’  EspoCRM-4.5.1.zip 100%[==============================> ]
24.72M 822KB/s in 59s 2018-02-26 17:10:36 (432 KB/s) - ‘ EspoCRM-4.5.1.zip’  saved [25926528/25926528]

And then, extract the package as follows.

root@linuxhelp1:~# unzip EspoCRM-4.5.1.zip 
Archive:  EspoCRM-4.5.1.zip
   creating: EspoCRM-4.5.1/
  inflating: EspoCRM-4.5.1/web.config  
  inflating: EspoCRM-4.5.1/upgrade.php  
.
.
  inflating: EspoCRM-4.5.1/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/html5shiv.js  
  inflating: EspoCRM-4.5.1/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/jquery.min.js  
  inflating: EspoCRM-4.5.1/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/nv.d3.min.js

After that, move file of Espocrm.

root@linuxhelp1:~# mv EspoCRM-4.5.1/ /var/www/espocrm/

And also, change ownership of Espocrm.

root@linuxhelp1:~# chown -R www-data.www-data /var/www/espocrm

Then restart apache2 as follows.

root@linuxhelp1:~# systemctl restart apache2

Also, you need to set value in API file. In that file, you need to set a value for RewriteBase. Once the value is changed, you need to save and exit the file.

root@linuxhelp1:~# vim /var/www/espocrm/api/v1/.htaccess
[..]
RewriteEngine On

# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase  /api/v1/

RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

And then, you need to restart the apache2 server.

root@linuxhelp1:~# systemctl restart apache2


After that, you need to create a Virtualhost. And make the modifications in it.

root@linuxhelp1:~# vim /etc/apache2/sites-available/espo.conf
< VirtualHost *:80> 
ServerName www.linuxhelp1.com
DocumentRoot /var/www/espocrm/

< Directory /var/www/espocrm/> 
AllowOverride All
allow from all
< /Directory> 

< /VirtualHost> 

And then, enable the Espo host configuration.

root@linuxhelp1:~# a2ensite espo.conf
Enabling site espo.
To activate the new configuration, you need to run:
  service apache2 reload

You need to now restart the Apache again.

root@linuxhelp1:~# systemctl restart apache2

And then, you need to disable default configuration by making use of the following command.

root@linuxhelp1:~# a2dissite 000-default.conf 
Site 000-default disabled. To activate the new configuration, you need to run: service apache2 reload


Now, open the browser.


And type your local IP or Domain name.


The EspoCRM site appears on your screen.


And then you need to accept license agreement to proceed further.


Configure the database and proceed.

And then, you need to verify module of EspoCRM.

And then, you need to click on the install button.


And then, you need to set Admin details.


And then configure the environment.


Also, you need to set the SMTP configuration.


Then the Crontab schedule appears. Go to the EspoCRM.


And then, log in to your account.


Then, open espoCRM.

You can check the version of the EspoCRM to know more information about it.

With this, the installation of EspoCRM comes to an end.

FAQ
Q
How do I find out more about members in EspoCRM?
A
To view information about a particular member, click on the user name. This will take you to their public profile page.
Q
Can I change the way the community looks in EspoCRM?
A
You may be able to change the styling of the community by using the style changer in the bottom left of the page. This lets you choose different styles which change the color scheme and appearance of the community. If this option does not appear, the board cannot be restyled.
Q
How to install EspoCRm on CentOS?
A
For the installation of the EspoCRM on CentOS, use the following link as given below "https://www.linuxhelp.com/how-to-install-espocrm-on-centos-7/"
Q
How to install SuiteCRM on Ubuntu?
A
For the installation of the SuiteCRM on Ubuntu, use the following link as given below "https://www.linuxhelp.com/how-to-install-suitecrm-7-10-2-ubuntu-17-04/".
Q
What are sticky topics in EspoCRM?
A
'Sticky' topics are topics determined to be important by moderators or administrators. They are listed at the top of the topic list and remain 'stuck' to the top of the listing, even if they haven't had any posts recently. Their purpose is to keep important information visible and accessible at all times.