You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Doug Bell <do...@plainblack.com> on 2009/05/16 01:39:44 UTC
Re: [users@httpd] ip-based vhost not working
On May 15, 2009, at 7:43 PM, graham wrote:
> Hi
>
> I'm having trouble setting up an ip-based vhost. It's something I've
> done ok in the past, but this time I just can't get it to work, and
> have
> tried so many variations on the configuration I feel I'm going in
> circles..
>
> This is a RH4 remotely hosted system with Apache 2.0. It was
> configured
> with one IP address (x.x.x.106) but the provider told me addresses
> x.x.x.107-110 were also available. I set up
> /etc/sysconfig/network-scripts/eth0:0, eth0:1, eth0:2 and eth0:3 with
> the respective IP addresses. ifconfig shows they are available. I can
> ping the host on each of the 5 IP addresses.
>
> The vanilla RH apache configuration was working. I set the default
> Listen config to '*:80'. I then added a vhost starting
>
> <VirtualHost x.x.x.107:80>
> ...
>
> /usr/sbin/httpd -S shows the vhost configuration has been accepted.
> But
> telnetting to x.x.x.107 gives me the pages from the default apache on
> x.x.x.106. The 107 vhost log files have been created, but stay at zero
> bytes.I cannot actually access my vhost, either externally or locally.
>
Do you have two specific NameVirtualHost lines?
NameVirtualHost x.x.x.106:80
NameVirtualHost x.x.x.107:80
Then make sure that all your <VirtualHost> match one or the other.
A NameVirtualHost *:80 will blanket all addresses apache is listening
on.
> If I change the configuration to add an explicit:
>
> Listen x.x.x.107:80
>
> apache refuses to restart, giving me the error:
>
> (99)Cannot assign requested address: make_sock: could not bind to
> address x.x.x.107:80
Did you remove the Listen *:80 line? Apache binds to the Listen
directives in order. so first it binds to *:80, then it tries to bind
to x.x.x.107:80 (which is already bound to apache) and fails.
Doug Bell -- Senior Developer, Plain Black Corp.
[ http://plainblack.com ]
all that groks is
---------------------------------------------------------------------
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
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ip-based vhost not working
Posted by graham <gr...@theseamans.net>.
Doug Bell wrote:
>
> Do you have two specific NameVirtualHost lines?
> NameVirtualHost x.x.x.106:80
> NameVirtualHost x.x.x.107:80
>
> Then make sure that all your <VirtualHost> match one or the other.
>
> A NameVirtualHost *:80 will blanket all addresses apache is listening on.
Thank you, that fixed it. It was in fact something I'd tried already -
but with a typo in one of the IP addresses. Serves me right for trying
to work too late at night.
Thanks again
Graham
---------------------------------------------------------------------
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
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org