Tuesday, May 4, 2010

How to set up ProxyPass and ProxyPassReverse in Apache

How to set up ProxyPass and ProxyPassReverse in Apache to allow access to Continuum (which runs on port 8080) and to Archiva (which runs on port 8082):

As root, edit: /etc/httpd/conf/httpd.conf

Enable:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so


At the bottom of the config file, add:

# ***********************************************************
ProxyRequests On
ProxyPreserveHost On
ProxyVia full


Order deny,allow
Allow from all


ProxyPass /archiva http://myserver.my.domain.com:8082/archiva
ProxyPassReverse /archiva http://myserver.my.domain.com:8082/archiva

ProxyPass /continuum http://myserver.my.domain.com:8080/continuum
ProxyPassReverse /continuum http://myserver.my.domain.com:8080/continuum
# ***********************************************************


Restart Apache: /etc/init.d/httpd restart