Virtual hosting and mod_proxy forwarding of different domains (httpd)
Let's say that you want to set up a single web server to look after several domains, but then have parts of those domains served by other 'back room' servers. This diagram give you the picture - a single incoming IP address / server with all the security and logging stuff on it (and probably handing a lot of the general traffic too), but other machine(s) in the background fulfilling other specific roles. I set up a configuration like this yesterday - as part of an httpd and Tomcat Deployment Course
The main server is Apache httpd (I had it on 192.168.200.214 - see diagram) and it was serving a domain called "devizes". [technical note - devizes.wellho.net or something fully qualifies when you take this out to the internet!]. However, I wanted to add the domains "lavington" and "urchfont" to it, with parts of the Lavington domain forwarded to another server on the same machine, and the entire Urchfont domain forwarded to another machine - 192.168.200.215.
Using Apache 2.2.x, I uncommented the virtual host support line in httpd.conf, and configured the virtual host file in the extra directory ... using mod_proxy to forward my traffic. The Virtual host configuration file, with lots of extra annotation, is available here
Notice that is doesn't matter what the background servers are running (httpd, Tomcat or something else), or whether they're on the same physical box or a different one. And the whole scheme will easily expand to using balancing with mod_proxy_balancer ... all of which are the subject of other resources you'll find here abouts! (written 2009-03-01)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articlesA608 - Web Application Deployment - Apache httpd mod_proxy 
Distributed, Balanced and Clustered Load Sharing - the difference - (2012-10-13) 
How can I run multiple web servers behind a single IP address? - (2012-04-02) 
Simplest ever proxy configuration? - (2011-06-28) 
Distributing the server load - yet ensuring that each user return to the same system (Apache httpd and Tomcat) - (2011-05-18) 
Load balancing with sticky sessions (httpd / Tomcat) - (2009-10-29) 
Apache, Tomcat, mod_proxy - (2009-08-06) 
Three recent questions on Tomcat Convertors - (2009-07-07) 
Forwarding session and cookie requests from httpd to Tomcat - (2008-12-14) 
mod_proxy_ajp and mod_proxy_balancer examples - (2008-12-13) 
mod_proxy and mod_proxy_ajp - httpd - (2008-08-22) 
Strange behaviour of web directory requests without a trailing slash - (2008-03-06) 
Choosing between mod_proxy and mod_rewrite - (2007-10-02) 
Sharing the load with Apache httpd and perhaps Tomcat - (2007-03-29) 
Apache httpd and Apache Tomcat together tips - (2006-12-24) 
Clustering, load balancing, mod_rewrite and mod_proxy - (2006-11-21) 
Apache httpd to Tomcat - jk v proxy - (2006-03-03)
Some other Articles
Melksham Industrial Static mirroring through HTTrack, wget and othersEast of Melksham CountrysideInternal Dummy Connections on Apache httpdVirtual hosting and mod_proxy forwarding of different domains (httpd)Tomcat 6 - Annotated Sample Configuration FilesDatabase connection Pooling, SSL, and command line deployment - httpd and TomcatSharing the load between servers - httpd and TomcatInvoker and cgi servlets on Tomcat 6Train and Coach fares from London (and airports) to Melksham
4208 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85 at 50 posts per page
This is a page archived from The Horse's Mouth at
the diary and writings of Graham Ellis.
Every attempt was made to provide current information at the time the
page was written, but things do move forward in our business - new software
releases, price changes, new techniques. Please check back via
our main site for current courses,
prices, versions, etc - any mention of a price in "The Horse's Mouth"
cannot be taken as an offer to supply at that price.
Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).