Name based virtual host bug after Apache restart
am 13.01.2010 15:39:56 von Chirouze Olivier --_000_A03AB46677048443A2923D043D579581259B93B44DSEGOTC5130C CR_ On Wed, Jan 13, 2010 at 2:39 PM, Chirouze Olivier Hi Tom, thanks for the so prompt answer! On Wed, Jan 13, 2010 at 10:00 AM, Chirouze Olivier > - the actual servername that bugs is of the form Of course, I should have guessed about the command just statically parsing =
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
After some years out of the Apache discussion, I'm back for a quite specifi=
c 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:
ServerName nameA1.org
ServerAlias nameA2.org
[...]
FileB:
ServerName nameB1.org
ServerAlias nameB2.org
[...]
(yes, I'm talking about same ip:port)
One day nameB1.org started not to work properly: requests to, say http://na=
meB1.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 resta=
rt we had done (without changing FileB at all).
Today we realized we had the problem again: I double checked logs and saw i=
t started after a restart I made. I tested that requests to nameB2.org work=
ed, _not_ nameB1.org: they were treated by httpd.conf and ended as "forbidd=
en" (because of course the proper Rewrite rules are in the appropriate virt=
ualhost).
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
we do have other servers of the form .co.uk, co.il, etc and they work as e=
xpected)
- 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 f=
rom the correct virtualhost, it SHOULD work.
- note that a serveralias in the same virtualhost still works: in fact, it'=
s ServerName www.something.com
mething.com. something.com goes to the correct virtualhost, www.something.c=
om
- originaly the servername was one of many serveraliases in a virtualhost. =
We extracted it to a separate virtualhost and conf file but the problem sti=
ll occurs.
Any idea???
Thanks!
Olivier
--_000_A03AB46677048443A2923D043D579581259B93B44DSEGOTC5130C CR_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>
e years out=20
of the Apache discussion, I'm back for a quite specific question...=20
;-)
een running=20
Apache HTTP Server 2.0 for some years now.=20
class=3D468405113-13012010>Everything work=
s fine as=20
expected but I think we encounter something that can only be a=20
bug.
ing _name=20
based virtual hosts_ and mod_rewrite. Each virtual host is defined in a spe=
cific=20
conf file that is included by httpd.conf
say:
alHost=20
ip:port>
e=20
nameA1.org
as=20
nameA2.org
FONT>
face=3DArial size=3D2>
face=3DArial=20
size=3D2>
alHost=20
ip:port>
e=20
nameB1.org
as=20
nameB2.org
talking=20
about same ip:port)
nameB1.org started not to work properly: requests to, say
href=3D"http://nameB1.org/ ">http://
color=3D#000000>nameB1.org/ didn't go to FileB, but were t=
reated=20
by httpd.conf. We could see that in log files. A simple restart and the pro=
blem=20
was fixed. A few weeks later, the problem reoccured and we realized it happ=
end=20
just after a restart we had done (without changing FileB at=20
all).
realized we=20
had the problem again: I double checked logs and saw it started after a res=
tart=20
I made. I tested that requests to nameB2.org worked, _not_ nameB1.org: they=
were=20
treated by httpd.conf and ended as "forbidden" (because of course the prope=
r=20
Rewrite rules are in the appropriate virtualhost).
:=20
_sometimes_ when we restart Apache, one of our many servernames/aliases doe=
sn't=20
go to the proper virtualhost, it is treated by httpd.conf.
IV>
o some=20
questions you might ask:
running=20
2.0.58
_always=20
the same servername_ that fails.
ual=20
servername that bugs is of the form
href=3D"http://www.aservername.co.za/">www.aservername.co.za (some=
thing=20
with the double country extension?? - we do have other servers of the form=
=20
..co.uk, co.il, etc and they work as expected)
FONT>- I=20
checked that the servername appears only in the proper virtual=20
host
ied that=20
DNS resolution stayed correct: the IP is always the one from the correct=20
virtualhost, it SHOULD work.
at a=20
serveralias in the same virtualhost still works: in fact, it's ServerName <=
A=20
href=3D"http://www.something.com">www.something.com and ServerAlias=20
something.com. something.com goes to the correct virtualhost,
href=3D"http://www.something.com">www.something.com doesn't.
>
ly the=20
servername was one of many serveraliases in a virtualhost. We extracted it =
to a=20
separate virtualhost and conf file but the problem still=20
occurs.
idea???
--_000_A03AB46677048443A2923D043D579581259B93B44DSEGOTC5130C CR_--
Re: Name based virtual host bug after Apache restart
am 13.01.2010 15:46:36 von Tom Evans
> Hi,
>
> After some years out of the Apache discussion, I'm back for a quite speci=
fic
> question... ;-)
>
> We have been running Apache HTTP Server 2.0 for some years now. Everythin=
g
> works fine as expected but I think we encounter something that can only b=
e a
> bug.
>
> We are using _name based virtual hosts_ and mod_rewrite. Each virtual hos=
t
> is defined in a specific conf file that is included by httpd.conf
>
> Let's say:
>
> FileA:
>
> ServerName nameA1.org
> ServerAlias nameA2.org
> [...]
>
>
> FileB:
>
> ServerName nameB1.org
> ServerAlias nameB2.org
> [...]
>
>
> (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 fixe=
d.
> 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 work=
ed,
> _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 b=
y
> 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 expect=
ed)
> - 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, i=
t'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 ``
place) rather than a specific ip:port.
Cheers
Tom
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See
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.orgRE: Name based virtual host bug after Apache restart
am 13.01.2010 16:00:10 von Chirouze Olivier
I didn't know that option of httpd, looks interesting.
As of today, the vhost goes to the appropriate file (according to the DUMP =
VHOST). But I would use that same command when it fails again (after next r=
eboot? ;-)
To answer your question, we are listening on different IPs and that is why =
we need to specify it in the vhost config.
Olivier
=20
> -----Original Message-----
> From: Tom Evans [mailto:tevans.uk@googlemail.com]=20
> Sent: 13 January 2010 15:47
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Name based virtual host bug after=20
> Apache restart
>=20
> On Wed, Jan 13, 2010 at 2:39 PM, Chirouze Olivier
>
> > Hi,
> >
> > After some years out of the Apache discussion, I'm back for=20
> a quite specific
> > question... ;-)
> >
> > We have been running Apache HTTP Server 2.0 for some years=20
> now. Everything
> > works fine as expected but I think we encounter something=20
> that can only be a
> > bug.
> >
> > We are using _name based virtual hosts_ and mod_rewrite.=20
> Each virtual host
> > is defined in a specific conf file that is included by httpd.conf
> >
> > Let's say:
> >
> > FileA:
> >
> > ServerName nameA1.org
> > ServerAlias nameA2.org
> > [...]
> >
> >
> > FileB:
> >
> > ServerName nameB1.org
> > ServerAlias nameB2.org
> > [...]
> >
> >
> > (yes, I'm talking about same ip:port)
> >
> > One day nameB1.org=A0started not to work properly: requests to,
> > say=A0http://nameB1.org/=A0 didn't go to FileB, but were=20
> treated by httpd.conf.
> > We could see that in log files. A simple restart and the=20
> problem was fixed.
> > A few weeks later, the problem reoccured and we realized it=20
> happend just
> > after a restart we had done (without changing FileB at all).
> >
> > Today we realized we had the problem again: I double=20
> checked logs and saw it
> > started after a restart I made. I tested that requests to=20
> nameB2.org worked,
> > _not_ nameB1.org: they were treated by httpd.conf and ended=20
> 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,=20
> 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=A0(something with the double country=20
> extension?? - we do
> > have other servers of the form .co.uk, co.il, etc and they=20
> work as expected)
> > - I checked that the servername appears only in the proper=20
> virtual host
> > - I verified that DNS resolution stayed correct: the IP is=20
> always the one
> > from the correct virtualhost, it SHOULD work.
> > - note that a serveralias in the same virtualhost still=20
> works: in fact, it's
> > ServerName www.something.com and ServerAlias something.com.=20
> something.com
> > goes to the correct virtualhost, www.something.com=A0doesn't.
> > - originaly the servername was one of many serveraliases in=20
> a virtualhost.
> > We extracted it to a separate virtualhost and conf file but=20
> the problem
> > still occurs.
> >
> > Any idea???
> >
> > Thanks!
> >
> > Olivier
>=20
> What does ``httpd -S -f /path/to/conf'' say about this vhost?
>=20
> 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.
>=20
> 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 ``
> place) rather than a specific ip:port.
>=20
> Cheers
>=20
> Tom
>=20
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP=20
> Server Project.
> See
> 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
>=20
> =
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See
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.orgRe: Name based virtual host bug after Apache restart
am 13.01.2010 16:14:38 von Eric Covener
> Hi Tom, thanks for the so prompt answer!
>
> I didn't know that option of httpd, looks interesting.
> As of today, the vhost goes to the appropriate file (according to the DUMP VHOST). But I would use that same command when it fails again (after next reboot? ;-)
that command doesn't query the running server, it just parses the
config file, so you won't see it change when you hit your alleged bug.
--
Eric Covener
covener@gmail.com
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See
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.orgRe: Name based virtual host bug after Apache restart
am 13.01.2010 16:16:35 von Eric Covener
> www.aservername.co.za=A0(something with the double country extension?? - =
we do
> have other servers of the form .co.uk, co.il, etc and they work as expect=
ed)
> - note that a serveralias in the same virtualhost still works: in fact, i=
t's
> ServerName www.something.com and ServerAlias something.com. something.com
> goes to the correct virtualhost, www.something.com=A0doesn't.
For relief, could you just duplicate the ServerName into the ServerAlias?
What rewrite stuff do you have that might care about incoming
hostnames or the servername?
--=20
Eric Covener
covener@gmail.com
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See
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.orgRE: Name based virtual host bug after Apache restart
am 13.01.2010 16:24:19 von Chirouze Olivier
files. However, at least I'd have a live proof that it's a bug if I run the=
command while the server behaves strange :-)
Sorry, what do you mean about duplicate? Would you mean:
ServerName nameB1.org
ServerAlias nameB1.org
ServerAlias nameB2.org
[...]
OR
ServerName nameB2.org
ServerAlias nameB1.org
[...]
?
By the way, I should have specified that we have a QA server with exact sam=
e configuration and off course, we can't reproduce the bug ;-)
Regarding Rewrite rules, we have plenty of them: the Apache I'm talking abo=
ut is a reverse proxy. But I'm pretty sure I would server a hello_world.htm=
l it would be the same...
Olivier
> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]=20
> Sent: 13 January 2010 16:17
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Name based virtual host bug after=20
> Apache restart
>=20
> > - the actual servername that bugs is of the form
> > www.aservername.co.za=A0(something with the double country=20
> extension?? - we do
> > have other servers of the form .co.uk, co.il, etc and they=20
> work as expected)
>=20
> > - note that a serveralias in the same virtualhost still=20
> works: in fact, it's
> > ServerName www.something.com and ServerAlias something.com.=20
> something.com
> > goes to the correct virtualhost, www.something.com=A0doesn't.
>=20
> For relief, could you just duplicate the ServerName into the=20
> ServerAlias?
>=20
> What rewrite stuff do you have that might care about incoming
> hostnames or the servername?
>=20
> --=20
> Eric Covener
> covener@gmail.com
>=20
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP=20
> Server Project.
> See
> 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
>=20
> =
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See
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