You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Darrel Austin <da...@visi.com> on 2001/12/31 19:49:53 UTC

Re: Re-> help getting help - more specific.

>> The documentation on name-based virtual hosting was rewritten a few months
>> ago.  Is it any clearer now?  Are there specific confusing things you can
>> point to?  (Specific is always more helpful than general.)

May I jump in with a quick suggestion?

I'm rather new to Web servers, in general, and I'm not sure if this is a
web-server issue, or specific to Apache, but it was a question that stumped
me (and pretty much everyone I asked that didn't have a deep understanding
of web hosting, either).

The question was how do I run two physical servers (with VirtualHosts)
behind one IP address? I had assumed that it was a simple means of setting
up the VirtualHost configurations to see and direct requests to the other
server. Alas, after about a weeks worth of research and asking several
people who all offered suggestions that they THOUGHT would work, it became
apparent that there is no real way to do it via the VirtualHost.

So, my suggestion would be to add a comment that says something to the
effect that VirtualHosts can only exist on the machine running Apache...for
those of us that just assumed that would work. ;o)

-Darrel


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Re-> help getting help - more specific.

Posted by Darrel Austin <da...@visi.com>.
Thanks Josh,

Yea, I figured it was more of an internet issue. What was interesting is how
many people couldn't figure this one out either. I had people offer all
sorts of interesting suggestions.

> Now, I'm not sure that an example like this really should be in the docs.
> If you don't really know what you are doing, you are just going to get
> yourself into trouble using this.

Agreed. 

Thanks for the tip, though. I may try getting myself into trouble this
week... ;)

-Darrel

on 12/31/01 1:02 PM, Joshua Slive at joshua@slive.ca wrote:

> 
>> From: Darrel Austin [mailto:daustin@visi.com]
> 
> 
>> The question was how do I run two physical servers (with VirtualHosts)
>> behind one IP address? I had assumed that it was a simple means of setting
>> up the VirtualHost configurations to see and direct requests to the other
>> server. Alas, after about a weeks worth of research and asking several
>> people who all offered suggestions that they THOUGHT would work, it became
>> apparent that there is no real way to do it via the VirtualHost.
> 
> This is not really a web server issue so much as a general internet issue.
> You can't, in general, have two machines with the same IP address, whether
> they are web servers or not.  The only exception is complicated
> load-balancing setups using fancy routers.
> 
> Having said that, it can actually be done by turning Apache into a fancy
> router.  I don't recommend this for a novice, but here goes:
> 
> NameVirtualHost *
> 
> <VirtualHost *>
> ServerName host1.example.com
> DocumentRoot /usr/local/apache/htdocs/
> </VirtualHost>
> 
> <VirtualHost *>
> ServerName host2.example.com
> ProxyPass / http://otherhost.example.com/
> ProxyPassReverse / http://otherhost.example.com/
> </VirtualHost>
> 
> Note that you need to have mod_proxy compiled into the server, and you need
> to be careful about how links on the backend otherhost.example.com server
> are constructed.  For more info, see the mod_proxy documentation.
> 
> Now, I'm not sure that an example like this really should be in the docs.
> If you don't really know what you are doing, you are just going to get
> yourself into trouble using this.
> 
> Joshua.
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: Re-> help getting help - more specific.

Posted by Joshua Slive <jo...@slive.ca>.
> From: Darrel Austin [mailto:daustin@visi.com]


> The question was how do I run two physical servers (with VirtualHosts)
> behind one IP address? I had assumed that it was a simple means of setting
> up the VirtualHost configurations to see and direct requests to the other
> server. Alas, after about a weeks worth of research and asking several
> people who all offered suggestions that they THOUGHT would work, it became
> apparent that there is no real way to do it via the VirtualHost.

This is not really a web server issue so much as a general internet issue.
You can't, in general, have two machines with the same IP address, whether
they are web servers or not.  The only exception is complicated
load-balancing setups using fancy routers.

Having said that, it can actually be done by turning Apache into a fancy
router.  I don't recommend this for a novice, but here goes:

NameVirtualHost *

<VirtualHost *>
ServerName host1.example.com
DocumentRoot /usr/local/apache/htdocs/
</VirtualHost>

<VirtualHost *>
ServerName host2.example.com
ProxyPass / http://otherhost.example.com/
ProxyPassReverse / http://otherhost.example.com/
</VirtualHost>

Note that you need to have mod_proxy compiled into the server, and you need
to be careful about how links on the backend otherhost.example.com server
are constructed.  For more info, see the mod_proxy documentation.

Now, I'm not sure that an example like this really should be in the docs.
If you don't really know what you are doing, you are just going to get
yourself into trouble using this.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org