View source | Discuss this page | Page history | Printable version   
Main Page
Upload file
What links here
Recent changes

PDF Books
Add page
Show collection (0 pages)
Collections help





Installing Apache Http Server

The Apache Http Server is a very commonly used web-server.

In an Openbravo Installation for production use we recommend to have it running logically before the Tomcat server to take care of the following tasks:

Main steps for doing that independent of the OS are:

The details of above steps can vary a lot depending on where apache webserver is installed from. Some distributions pre-configure many details already with good defaults, others offer very little or leave things up to the administrator.

Typically installs also add a redirect for the main site's landing page to /openbravo to avoid every user to need to type this on their own.

There are many ways to do this redirect, a simple way to do it is creating an index.html in the apache webroot with this content:

<META HTTP-EQUIV="Refresh" CONTENT="0; URL=openbravo">

Example Install on Ubuntu 18.04

Install Apache Webserver, mod_jk connector and tomcat native libraries

sudo su -  
apt-get install apache2 libapache2-mod-jk libtcnative-1

Ubuntu 18.04 has mod_deflate already configured for most mime-types and also already has an mod_jk worker named 'ajp13_worker' pre-configured to point to the AJP 8009 port used by tomcat. That simplifies the configuration a lot as only the following is needed to be added:

Create /etc/apache2/conf-available/openbravo.conf file

<IfModule mod_deflate.c>
          AddOutputFilterByType DEFLATE application/json
jkMount /openbravo* ajp13_worker
JkMountCopy all

Activate the new config file

sudo su -
a2enconf openbravo

Optionally but recommeded is to add https/SSL support.

The steps needed to configure this are the same as documented for the Openbravo Appliance and can be taken from there.

Example install Apache on Windows

Bulbgraph.png   This section was written for an older version and is outdated. It is kept as a reference but should not be just used 'as written'

The Apache Httpd project itself does not produce a binary installation for windows. However several external sites do.

For the rest of this guide we selected the Apache Lounge site for the following reasons:

Note: Choice of that binary provider is just an example and the user of this guide is in charge of maintaining & updating the installation. However this binaries seem to just work fine for Openbravo use while preparing this guide.

The concrete versions used for this guide were Apache 2.4.12 Win64 VC14 binaries and mod_jk-1.2.40-win64-VC14.

It is strongly recommended when using this guide to use the latest version available at that time as those written here will then most likely be outdated (and probably insecure as new security updates are made available regularly).

Basic Apache installation

This part describes the basic Apache Http server installation on windows to get it installed and running as a windows service.

cd C:\Apachet24\bin\
httpd -k install

Note: If the Apache service fails to start additionally to the usual logs/error.log file also check the Windows Event Log for the category Application. As some type of problem like errors in the configuration files will only be shown there.

Installing & Configuring mod_jk

jkMount /openbravo* node1
jkMount /manager* node1
jkMount /OpenbravoDiagnostics* node1
jkMountCopy all
Include conf/httpd-jk.conf
Include conf/openbravo.conf

Configuring compression

This configuration is technically optional but highly recommended.

Goal of it is to transparently compress outgoing data from the server to the client on the fly so that it has reduced size thus less bandwidth is used and the users get a better response time indirectly.

#LoadModule filter_module modules/
#LoadModule deflate_module modules/
<IfModule mod_deflate.c>
    # Apache standard
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/xml
    # added for Openbravo
    AddOutputFilterByType DEFLATE application/json
  1. Restart the Apache Http Server
  2. To test using either chrome developer tool or the Firefox Developer network tool verify the Transferred and Size column. Example for js-files there will be a noticeable reduction in transferred size compared to content size.

Configuring https/SSL

This section explain how to setup https/ssl handled via Apache.

All the necessary extra code + binaries are already included and the feature just need to be activated.

To activate the module for ssl edit the main conf/httpd.conf file and uncommented the following 3 lines:

#LoadModule socache_shmcb_module modules/
#LoadModule ssl_module modules/
#Include conf/extra/httpd-ssl.conf

Then edit the conf/extra/httpd-ssl.conf file to add your certificate related files. For example if you placed those into C:\Apache24\ssl then you will need to edit the following 3 lines to point them to your filenames:

SSLCertificateFile       C:\Apache24\ssl\<key-name>.pem
SSLCertificateKeyFile    C:\Apache24\ssl\<key-name>.key
SSLCertificateChainFile  C:\Apache24\ssl\<key-name>-ca.crt

For more information about those files please check the following page.

Possible conflicts with security systems

As said in Apache's Documentation, the AcceptFilter default configuration from apache can have conflicts with some security systems (spam, virus or spyware filters) in Windows. If this happens, these security systems can shutdown Apache, in these cases this additional configuration is needed:

AcceptFilter https none
AcceptFilter http none
EnableMMAP off

Retrieved from ""

This page has been accessed 38,624 times. This page was last modified on 22 October 2018, at 11:37. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.