Wednesday, 17 August 2011

Proxying from apache2 to application server (eg tomcat, jetty)

It is often convenient to proxy an application server, such as Jetty or Tomcat, as these tend to be mounted on ports other than port 80. The following steps worked in an Ubuntu setup.

Enable mod_proxy
a2enmod proxy
a2enmod proxy_http

Edit sites-enabled/default to add your proxying rule, eg:
ProxyPass /alfresco http://localhost:8080/alfresco
ProxyPassReverse /alfresco http://localhost:8080/alfresco
<Proxy http://localhost:8080/alfresco*>
Order deny,allow
Allow from all
</Proxy>

/etc/init.d/apache2 restart

You should now see your application server content on your default url ie http://localhost/alfresco will contain the same content as
http://localhost:8080/alfresco.

No comments:

Post a Comment