13. Installing an Apache reverse proxy as a front-end to your MMBase server

Installing an Apache reverse proxy is an easy alternative to the JK 2 Connector to use Apache as a front-end to your Tomcat server.

Add to your Apache (virtual) server configuration (replace <hostname> with your hostname):

  
  ProxyPass /tomcat/ http://<hostname>:8080/
  ProxyPassReverse /tomcat/ http://<hostname>:8080/
  ProxyPass /mmbase/ http://<hostname>:8080/mmbase-webapp/
  ProxyPassReverse /mmbase/ http://<hostname>:8080/mmbase-webapp/
  
  

This allows you to access your Tomcat server as (replace <hostname> with your hostname):

  
  http://<hostname>/tomcat/
  
  

and your MMBase server as (replace <hostname> with your hostname):

  
  http://<hostname>/mmbase/
  
  

Caution

Our MMBase version 1.7 installation used absolute directory paths in the web pages it generated. In order to get the reverse proxies to work properly, the Apache proxy paths had to be the same (replace <hostname> with your hostname):

  
  ProxyPass /mmbase-webapp/ http://<hostname>:8080/mmbase-webapp/
  ProxyPassReverse /mmbase-webapp/ http://<hostname>:8080/mmbase-webapp/