Fronting JBoss with Apache

Introduction

Many people prefer to have Apache forward web requests to their Bedework server.   They may do so because they are more comfortable in Apache or because they enjoy its flexibility.   In this scenario, Apache serves out static content (including, often, static Bedework content), fronts some PHP-based tools, such as phpPgAdmin, AND passes Bedework requests to JBoss at port 8080.  

There are at least two Apache2 modules that can pass requests to JBoss:  mod_jk and mod_proxy.   Both should work.  The instructions below assume mod_proxy.   They also assume you are running on a Linux server.

Get Apache Ready

  1. Install apache2, if not already present, via yum, apt-get, or download
  2. Enable apache2's mod-proxy, mod-rewrite, and mod_proxy_ajp modules (if these did not come by default with your apache2 distro, you'll need to install it via yum, apt-get, or download)
    1. sudo a2enmod proxy
    2. sudo a2enmod rewrite 
    3. sudo a2enmod proxy_ajp
  3. cd to your apache configuration area, generally /etc/apache2 or /etc/httpd on Linux and c:\apache2 on Windows.
  4. cd to conf.d and create bedework.conf

Bedework.conf

You can start with these contents:

ProxyPass / ajp://localhost:8009/
# or ProxyPass specific end points rather than proxying everything bubbling up from JBoss.  For example:
#    ProxyPass /cal ajp://localhost:8009/cal
# If proxying everything from /, add entries like the following for anything served directly by Apache:
#    ProxyPass /phpPgAdmin ! 
# If you move your stylesheets and web resources to Apache, then you might end up with an entry like this
#    ProxyPass /bwRoot !
# where <DocumentRoot>/bwRoot would contain calrsrc.MainCampus, caladminrsrc, etc., copied from <jbossDir>/server/default/deploy/ROOT.war

RewriteEngine on
RewriteRule ^/$ /cal/ [R]
# once SSL is enabled, uncomment these rules
#RewriteRule ^/eventsubmit(.*) https://%{SERVER_NAME}/eventsubmit
#RewriteRule ^/caladmin(.*) https://%{SERVER_NAME}/caladmin
#RewriteRule ^/jmx-console(.*) https://%{SERVER_NAME}/jmx-console

 

You can test your configuration changes with apachectl configtest.

Once it passes, restart Apache:  

  • On linux:  /etc/init.d/apache2 restart or /etc/init.d/httpd restart
  • On Windows, restart the service.

Now see if you can reach the Bedework clients on port 80.

Bedework Enterprise Calendar Server, version 3.10