­
+1 (408) 320-0380

Apache server configuration for EspoCRM on Ubuntu server

This post may not be actual at this moment. Please follow to the article in the documentation.

These instructions are supplementary to the Server Configuration guideline. Please note that all configuration settings listed here are made on Ubuntu server.

PHP requirements

To install all necessary libraries, run these commands in a terminal:

1
2
3
4
sudo apt-get update
sudo apt-get install php-mysql php-json php-gd php-mcrypt php-zip php-imap php-mbstring php-curl
sudo phpenmod mcrypt imap mbstring
sudo service apache2 restart

Fixing the issue “API Error: EspoCRM API is unavailable”:

Take only necessary steps. After each step check if the issue is solved.

1. Enable “mod_rewrite” support in Apache

To enable “mod_rewrite,” run these commands in a terminal:

1
2
sudo a2enmod rewrite
sudo service apache2 restart

2. Enable .htaccess support

To enable .htaccess support, add/edit the Server Configuration Settings /etc/apache2/sites-available/ESPO_VIRTUAL_HOST.conf or /etc/apache2/apache2.conf (/etc/httpd/conf/httpd.conf):

1
2
3
<Directory /PATH_TO_ESPO/>
AllowOverride All
</Directory>

Afterward, run this command in a terminal:

1
sudo service apache2 restart

3. Add RewriteBase path

Open a file /ESPOCRM_DIRECTORY/api/v1/.htaccess and replace the following line:

1
# RewriteBase /

with

1
RewriteBase /REQUEST_URI/api/v1/

where REQUEST_URI is a part of URL, e.g. for “http://example.com/espocrm/”, REQUEST_URI is “espocrm”.

Enable HTTP AUTHORIZATION support (only for FastCGI).

FastCGI does not support HTTP AUTHORIZATION by default. If you use FastCGI, you have to enable it in your VirtualHost or /etc/apache2/apache2.conf (httpd.conf) by adding the following code:

For Fcgid module:

1
2
3
4
5
<IfModule mod_fcgid.c>
  FcgidPassHeader Authorization
  FcgidPassHeader Proxy-Authorization
  FcgidPassHeader HTTP_AUTHORIZATION 
</IfModule>

For FastCgi module:

1
2
3
4
5
<IfModule mod_fastcgi.c>
   FastCgiConfig -pass-header Authorization \
                        -pass-header Proxy-Authorization \
                        -pass-header HTTP_AUTHORIZATION 
</IfModule>

To check which module is currently being used, run this command and find the module:

1
apache2ctl -M

Cookies & Privacy Policy

Our website uses cookies to give you the best user experience on our website and to help us deliver our services. By using our services, you agree to our use of cookies. Click here for more information.
Necessary
Strictly necessary cookies help make a website navigable by activating basic functions such as page navigation and access to secure website areas. Without these cookies, the website would not be able to work properly.
Statistical
Statistical cookies help the website owner understand how visitors interact with the website by collecting and reporting information.
Marketing
Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and interesting to the individual user and thus more valuable for publishers and third-party advertisers.
Accept AllCustomizeAccept Necessary