Re: Name based virtual host bug after Apache restart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 13, 2010 at 2:39 PM, Chirouze Olivier
<olivier.chirouze@xxxxxxxxx> wrote:
> Hi,
>
> After some years out of the Apache discussion, I'm back for a quite specific
> question... ;-)
>
> We have been running Apache HTTP Server 2.0 for some years now. Everything
> works fine as expected but I think we encounter something that can only be a
> bug.
>
> We are using _name based virtual hosts_ and mod_rewrite. Each virtual host
> is defined in a specific conf file that is included by httpd.conf
>
> Let's say:
>
> FileA:
> <VirtualHost ip:port>
> ServerName nameA1.org
> ServerAlias nameA2.org
> [...]
> </VirtualHost>
>
> FileB:
> <VirtualHost ip:port>
> ServerName nameB1.org
> ServerAlias nameB2.org
> [...]
> </VirtualHost>
>
> (yes, I'm talking about same ip:port)
>
> One day nameB1.org started not to work properly: requests to,
> say http://nameB1.org/ ; didn't go to FileB, but were treated by httpd.conf.
> We could see that in log files. A simple restart and the problem was fixed.
> A few weeks later, the problem reoccured and we realized it happend just
> after a restart we had done (without changing FileB at all).
>
> Today we realized we had the problem again: I double checked logs and saw it
> started after a restart I made. I tested that requests to nameB2.org worked,
> _not_ nameB1.org: they were treated by httpd.conf and ended as "forbidden"
> (because of course the proper Rewrite rules are in the appropriate
> virtualhost).
>
> In a word: _sometimes_ when we restart Apache, one of our many
> servernames/aliases doesn't go to the proper virtualhost, it is treated by
> httpd.conf.
>
> Answers to some questions you might ask:
> - we are running 2.0.58
> - This is _always the same servername_ that fails.
> - the actual servername that bugs is of the form
> www.aservername.co.za (something with the double country extension?? - we do
> have other servers of the form .co.uk, co.il, etc and they work as expected)
> - I checked that the servername appears only in the proper virtual host
> - I verified that DNS resolution stayed correct: the IP is always the one
> from the correct virtualhost, it SHOULD work.
> - note that a serveralias in the same virtualhost still works: in fact, it's
> ServerName www.something.com and ServerAlias something.com. something.com
> goes to the correct virtualhost, www.something.com doesn't.
> - originaly the servername was one of many serveraliases in a virtualhost.
> We extracted it to a separate virtualhost and conf file but the problem
> still occurs.
>
> Any idea???
>
> Thanks!
>
> Olivier

What does ``httpd -S -f /path/to/conf'' say about this vhost?

Is the vhost that it ends up going to the default vhost? Ie the first
encountered when parsing the conf file.
This would indicate that the requested hostname didn't match any other
applicable vhost.

The one weird thing in your config is that you are specifying an
ip:port for your vhosts. Are you using _solely_ name based virtual
hosting? If so, I would configure the vhosts with ``<VirtualHost
*:80>'' (and obviously, ``NameVirtualHost *:80'' in the appropriate
place) rather than a specific ip:port.

Cheers

Tom

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux