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 instead use:

yum install httpd24 mod24_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. Upload virus scanning and protection against server attacks 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
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 instead use:

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