geediu Posted December 11, 2008 Share Posted December 11, 2008 Hi, I am somewhat new to apache and I hope someone could help me out with the following hosting problem: I currently host multiple web sites (eg. www.orange.com, www.banana.com, www.melon.com) on one apache 2.2.6 box (eg. 10.1.1.101). The apache box is behind a firewall and all the different domain names resolve to the same external IP (eg. 64.114.20.24) which in turn gets port forwarded to the apache box by the firewall. the virtualhost portion of httpd.conf looks like this: NameVirtualHost * <VirtualHost *> ServerName www.orange.com DocumentRoot c:/sites/www/www.orange.com </VirtualHost> <VirtualHost *> ServerName www.banana.com DocumentRoot c:/sites/www/www.banana.com </VirtualHost> <VirtualHost *> ServerName www.melon.com DocumentRoot c:/sites/www/www.melon.com </VirtualHost> I'd like to set up a wiki for the melon.com site, namely wiki.melon.com. I found a wiki software out there which comes in as a virtual appliance. I have it set up already running as 10.1.1.102 on the same network. I cannot get another external IP so I have to set up the DNS for wiki.melon.com to use 64.114.20.24. That means when people try to hit wiki.melon.com it is going to go to the first apache server. My question then is, if there is a way to get the first apache box on 10.1.1.101 to forward the requests for wiki.melon.com to the other server (10.1.1.102)? Is mod_rewrite the solution, and if so would someone show me the way? Many thanks in advance, Geediu Quote Link to comment Share on other sites More sharing options...
corbin Posted December 11, 2008 Share Posted December 11, 2008 mod_proxy is all that I can think of that will work x.x. It would be a very simple configuration, so I'm sure you can figure it out if you read the docs. Quote Link to comment Share on other sites More sharing options...
geediu Posted December 11, 2008 Author Share Posted December 11, 2008 mod_proxy worked beautifully. I thought I'd share my new httpd.conf (the relevant sections): LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so NameVirtualHost * <VirtualHost *> ServerName www.orange.com DocumentRoot c:/sites/www/www.orange.com </VirtualHost> <VirtualHost *> ServerName www.banana.com DocumentRoot c:/sites/www/www.banana.com </VirtualHost> <VirtualHost *> ServerName www.melon.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://10.1.1.102/ ProxyPassReverse / http://10.1.1.102/ </VirtualHost> Thanks again, Geediu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.