Apache Configurations

For various reasons it is often desirable to deploy reviki on a servlet container that is itself behind the apache webserver. This page is will document known working configurations and track effort to make this process easier.

Note in the examples below various demo.localhost style hosts are used in place of your Apache hostname. The host we're proxying to, running tomcat, is always referred to as localhost.

Usecase 1

Tomcat running reviki in default setup, with /reviki context. Apache virtual host proxying to /reviki from some other URL giving the following URL public structure:

http://demo.localhost/here/$wikiName/$pageName

Example virtual server configuration

The configuration below is supported from revision:967.

<VirtualHost *>
  ServerName demo.localhost

  <Proxy *>
    Order allow,deny
    Allow from all
  </Proxy>

  ProxyRequests Off
  ProxyVia On

  RequestHeader set X-Reviki-Base-Location http://demo.localhost/here/
  ProxyPass /here/ ajp://localhost:8009/reviki/
  ProxyPassReverse /here/ ajp://localhost:8009/reviki/
  ProxyPassReverseCookiePath /reviki /here
</VirtualHost>

You'll always have to do more than just proxy as reviki needs to know how to generate full URLs to pages (e.g. for atom feed). We pass the base URL as a custom header that reviki understands.

You can use the server root by using '/' where we reference 'here' above.

Note you need to enable several apache modules. On Debian based Linux distros this can be done as follows:

a2enmod proxy
a2enmod proxy-ajp
a2enmod headers

Usecase 2

Present only a single wiki publicly, e.g. /reviki/public/FrontPage should be exposed at

http://demo2.localhost/FrontPage

To be continued...