Configuring Apache

Package installation

First, install the Apache server packages if they are not already present.

On OpenSuse use:

zypper install apache2

On Amazon Linux 2 instead use:

yum install httpd mod_ssl


While Tomcat can be used on its own to directly service clients, normally we would recommend using it behind Apache to take advantage of its cacheing facilities. Other services and features can also be more easily integrated in Apache.

A typical configuration for a Jiglu virtual host is as follows:

ServerAdmin (Address removed)

DocumentRoot "/var/lib/wwwrun"

AllowEncodedSlashes on
HostnameLookups Off
UseCanonicalName Off

ProxyRequests off

ProxyPass /ws/ ws://
ProxyPassReverse /ws/ ws://

ProxyPass / max=100 nocanon
ProxyPassReverse /

CacheIgnoreHeaders Set-Cookie
CacheRoot /var/cache/httpd/
CacheEnable disk /

<LocationMatch "^/(editor|fonts|images|scripts|stylesheets)/">
ExpiresActive on
ExpiresDefault "access plus 1 year"
Header merge Cache-Control public
Header always unset Set-Cookie

SSLEngine on
SSLCertificateFile /etc/apache2/certs/example.crt
SSLCertificateKeyFile /etc/apache2/keys/example.key

ErrorLog /var/log/apache2/jiglu-error_log

The mod_cache, mod_cache_disk, proxy, proxy_http and proxy_wstunnel modules must be loaded.

Note that the websocket proxy definition must precede the http proxy definition.

Automatic starting

To enable Apache to start when the server is booted, on OpenSuse use:

systemctl enable apache2
systemctl start apache2

On Amazon Linux, Fedora or Redhat use:

systemctl enable httpd
systemctl start httpd
Written by Stephen Hebditch. Published on .
How to configure Apache as an accelerating reverse proxy for Jiglu.