Jump to content

Question on virtualhost


geediu

Recommended Posts

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.