Simple Way to Use Apache as a Reverse Proxy

Simple Way to Use Apache as a Reverse Proxy

Posted:  November 10, 2013

Simple Way to Use Apache as a Reverse Proxy


Am a developer.  As a result, I know a multitude of different programming and scripting languages ranging from Visual Basic to HTML and just about everything between.  As a result I do a multitude of projects.  Now my main server…. the one I do the most development on is a Ubuntu Linux server… but because I also need to develop for Microsoft technologies, I need to have a Windows Server virtual machine on it.

Since some of these sites I work on need to be run in a windows environment, I also need a way I can still send all my requests to and through my LAMP box, and pass them off to my windows VM residing on it.

I will not go into how I set the VM, #1 it was a nightmare, #2 that is out of the context of this post.

I will however, tell you how I configured Apache to serve all requests for particular sites to pass through to IIS on the VM.

<VirtualHost *>
    ProxyPreserveHost On
    ProxyRequests off
    ProxyPass / http://192.168.X.X/
    ProxyPassReverse / http://192.168.X.X/

As you can see here, it’s not all that complicated.  You swap out to the domain of the site you want to pass over to IIS, and change the IP addresses to that of your VM.  Please make sure your install of apache has the proxy modules enabled before attempting the above.

a2enmod proxy
a2enmod proxy_http
service apache2 restart

Kevin Pirnie

20+ Years of PC and server maintenance & over 15+ years of web development/design experience; you can rest assured that I take every measure possible to ensure your computers are running to their peak potentials. I treat them as if they were mine, and I am quite a stickler about keeping my machines up to date and optimized to run as well as they can.