[PLUG] Apache question
Matt Alexander
lug at phxlinux.org
Wed Jun 2 13:43:02 UTC 2004
On Wed, 2 Jun 2004, Ryan Schlosser wrote:
> On Wed, 2 Jun 2004 13:09:27 -0700 (MST), Matt Alexander
> <lug at phxlinux.org> wrote:
> >
> > Seems like this should be a simple thing...
> >
> > How can I make connections to the IP address of my box go to one dir and
> > connections using a domain name go to a different dir?
> >
>
> I think you should just have to setup two virtual hosts, one for the
> IP and one for the Domain and point each to a different directory.
>
> So like in my conf I have virtual host for <machinename>.<domainname>
> as the default for the IP - and a virtual host setup for all the other
> domains I host on it.
This box has multiple IP addresses... I've got the ServerName parameter
set to one IP address. Then I have the NameVirtualHost parameter using
the same IP address. Then I created VirtualHost entries for the IP
address specified in ServerName and well as entries for the other IP
addresses. Connections to the other IP addresses and domain names work as
they should, but connections to the IP address in the ServerName parameter
seem to ignore the VirtualHost entry and instead use the first VirtualHost
entry in the httpd.conf instead. So I fixed it by moving the VirtualHost
entries around so the first is a default dir.
Strange.
~M
More information about the PLUG
mailing list