Using mod_proxy to 'include' other servers while maintaining fancy URLs

On this server (hardware) I'm running 4 different servers (software), which are:

(Perhaps some more in the future)

In the URLs I didn't need a port number, because I used Apache's mod_proxy:

# This module isn't turned on by default:
LoadModule proxy_module modules/mod_proxy.so
AddModule mod_proxy.c

# For your own safety (see this and this. Summary: Open proxy servers are dangerous both to your network and to the Internet at large.):
ProxyRequests off

# And the final stuff (see this):
ProxyPass /stuff/asp-net/ http://krijnhoetmer.nl:8080/stuff/asp-net/
ProxyPass /stuff/jsp/ http://krijnhoetmer.nl:8008/stuff/jsp/
ProxyPass /stuff/ruby/ http://krijnhoetmer.nl:8088/stuff/ruby/

It took me quite a while to find some examples like this on the internet (apart from Apache.org), so perhaps this is useful to somebody out there. You can of course also 'include' different servers (not only using different port numbers). Very handy!

On this server's (Apache) docroot I also included the directories /stuff/asp-net/, /stuff/ruby/ and /stuff/jsp/. By doing this you make sure Apache redirects /stuff/jsp to /stuff/jsp/, after which the ProxyPass does his work.


Home - More stuff