Deploying Multiple apps on one IP with Apache’s ProxyPass
Say you’re poor and only have one IP address. If you have the ability to control your own DNS, there’s an easy fix.
- Install Apache on one of your servers on Port 80
- Add this to the bottom of the Apache httpd.conf file
NameVirtualHost 192.168.1.5 <VirtualHost 192.168.1.5> ServerName myapp.mydomain.com ProxyPass / http://internal.mydomain.com/ #TransferLog /net/www/logs/sun.docs.access #ErrorLog /net/www/logs/sun.docs.errror </VirtualHost>
This will work to forward requests to many backend servers. Just keep in mind that the IP addresses from the outside won’t show up in your logs. There are ways around that though.
