[Cialug] 2 web servers 1 IP

chris chris at ia.gov
Tue Jan 12 07:09:21 CST 2010


> Look into Nginx. It will do exactly what you want and can actually
> increase the performance of your apps by reducing the number of
> connections to your application server (Apache in this case).
> 

If you are more comfortable with Apache HTTPD, mod_proxy will do this as well.  (In addition to caching, connection
pooling, load balancing, mod_rewrite and all the other goodies.)

Here's a quick howto written by the Nick Kew author of the HTTP Modules book:
http://www.apachetutor.org/admin/reverseproxies .  He dives into more than you will probably need, but his
mod_proxy_html stuff can come in handy in a pinch.

The config for two web services on different back end hosts can be as simple as this:

LoadModule  proxy_module         modules/mod_proxy.so
LoadModule  proxy_http_module    modules/mod_proxy_http.so

ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>


<VirtualHost *:80>
                Servername     www.buymore.com
                ProxyPreserveHost On
                Proxypass /     http://192.168.0.83/
</VirtualHost>


<VirtualHost *:80>
                Servername
                Serveralias    www.bazinga.com
                ProxyPreserveHost On
                Proxypass /     http://192.168.0.157/
</VirtualHost>


If you need some help email me or join #httpd (or #cialug) on freenode and we'll get you on your way.

crr
arreyder at apache.org





More information about the Cialug mailing list