Tuesday, 16 June 2009

Notes on setting up mod_proxy on apache 2.2 for proxying a servlet container (like glassfish)

Just wanted to make these notes before I forget - the aim here was to create a vhost (or potentially several vhosts) which map to different projects hosted on (some kind) of servlet container like glassfish:

1. Install or upgrade to the latest version of Apache http server (Apache 2.2)
2. edit your hosts file (C:\WINDOWS\system32\drivers\etc) to add the name for whatever you need to proxy (as per usual vhost settings):



3. edit httpd.conf (For Windows, it should be in C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf):

ensure both

Are uncommented in order for proxying to work correctly.

Also ensure the httpd-vhosts.conf include is being "Included" by uncommenting:



4. edit C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf

Delete (or uncomment) any of the default install stuff in there... If you're using a different folder, you'll have to configure the permissions (OSX):

# This block sets the permissions for apache (n.b. these differ from the OS file permissions)


# setting localhost's "starting point"; in this case, it's my workspace folder, so I can see all my projects


#setting the rewrite / proxy rules for your hostname


Restart apache and mod_proxy should be working.

No comments:

Blog Archive