Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #157577 > unrolled thread

Re: Re: Apache's strange behavior on Debian?

Started bymizuki <mizuki0621@gmail.com>
First post2015-09-08 19:30 +0200
Last post2015-09-08 22:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  Re: Re: Apache's strange behavior on Debian? mizuki <mizuki0621@gmail.com> - 2015-09-08 19:30 +0200
    Re: Apache's strange behavior on Debian? Jochen Spieker <ml@well-adjusted.de> - 2015-09-08 19:50 +0200
    Re: Apache's strange behavior on Debian? Jochen Spieker <ml@well-adjusted.de> - 2015-09-08 22:20 +0200

#157577 — Re: Re: Apache's strange behavior on Debian?

Frommizuki <mizuki0621@gmail.com>
Date2015-09-08 19:30 +0200
SubjectRe: Re: Apache's strange behavior on Debian?
Message-ID<q6uSv-2sW-19@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi John,

Just to clarify, I have one Apache installation on a frond-end proxy, and
one on a backend server. On the backend, I have 2 Apache virtual hosts
configured on the backend individually called ServerA.local and
ServerB.local, 2 Apache virtual hosts on the proxy called ServerA.com and
ServerB.com for corresponding virtual hosts on the backend. So the traffic
is expected to like below:

https://ServerA.com => https://ServerA.local
https://ServerB.com => https://ServerB.local

I have "ProxyPreserveHost On" on the proxy side for both apache virtual
hosts, also had "%{X-Forwarded-For}i %v %l %u %t \"%r\" %>s %b" options for
verbose logging on the backend, everytime when I go https://ServerB.com,
the contents of https://ServerA.com get displayed, on the proxy logging
side, I do see the correct URL https://ServerB.com when the requests coming
in, but on the backend, I see serverA-local.log records all the activities,
clearly the traffic has been directed to the wrong Apache virtual host on
the backend. Since everything is displayed fine w/o going through proxy
(i,e: https://ServerB.local & https://ServerA.local displays everything
fine), I assume something is broken on the Apache proxy? This is actually
very easy to produce, no complicated rules on both backend and proxy, all
most basically stuff...
Thanks.

Mizuki

[toc] | [next] | [standalone]


#157580

FromJochen Spieker <ml@well-adjusted.de>
Date2015-09-08 19:50 +0200
Message-ID<q6vbP-2PL-9@gated-at.bofh.it>
In reply to#157577

[Multipart message — attachments visible in raw view] — view raw

Hi Mizuki,

would you mind if I respond on the list? 

Regards,
Jochen.

mizuki:
> Hi John,
> 
> Just to clarify, I have one Apache installation on a frond-end proxy, and
> one on a backend server. On the backend, I have 2 Apache virtual hosts
> configured on the backend individually called ServerA.local and
> ServerB.local, 2 Apache virtual hosts on the proxy called ServerA.com and
> ServerB.com for corresponding virtual hosts on the backend. So the traffic
> is expected to like below:
> 
> https://ServerA.com => https://ServerA.local
> https://ServerB.com => https://ServerB.local
> 
> I have "ProxyPreserveHost On" on the proxy side for both apache virtual
> hosts, also had "%{X-Forwarded-For}i %v %l %u %t \"%r\" %>s %b" options for
> verbose logging on the backend, everytime when I go https://ServerB.com,
> the contents of https://ServerA.com get displayed, on the proxy logging
> side, I do see the correct URL https://ServerB.com when the requests coming
> in, but on the backend, I see serverA-local.log records all the activities,
> clearly the traffic has been directed to the wrong Apache virtual host on
> the backend. Since everything is displayed fine w/o going through proxy
> (i,e: https://ServerB.local & https://ServerA.local displays everything
> fine), I assume something is broken on the Apache proxy? This is actually
> very easy to produce, no complicated rules on both backend and proxy, all
> most basically stuff...
> Thanks.
> 
> Mizuki

-- 
If I was Mark Chapman I would have shot John Lennon with a water pistol.
[Agree]   [Disagree]
                 <http://www.slowlydownward.com/NODATA/data_enter2.html>

[toc] | [prev] | [next] | [standalone]


#157590

FromJochen Spieker <ml@well-adjusted.de>
Date2015-09-08 22:20 +0200
Message-ID<q6xx0-6mP-7@gated-at.bofh.it>
In reply to#157577

[Multipart message — attachments visible in raw view] — view raw

[D'ouh! I only saw your response in my inbox and didn't notice that a
copy also went to the list.]

mizuki:
> 
> Just to clarify, I have one Apache installation on a frond-end proxy, and
> one on a backend server. On the backend, I have 2 Apache virtual hosts
> configured on the backend individually called ServerA.local and
> ServerB.local, 2 Apache virtual hosts on the proxy called ServerA.com and
> ServerB.com for corresponding virtual hosts on the backend. So the traffic
> is expected to like below:
> 
> https://ServerA.com => https://ServerA.local
> https://ServerB.com => https://ServerB.local

Ok, I get that.

> I have "ProxyPreserveHost On" on the proxy side for both apache virtual
> hosts,

Why? I didn't want to imply that it is a solution to your problem. I
just wanted to mention it since I found it helpful in one case.  You
only need ProxyPreserveHost if your backend server is configured to use
the same ServerName as your frontend server.

> also had "%{X-Forwarded-For}i %v %l %u %t \"%r\" %>s %b" options for
> verbose logging on the backend, everytime when I go https://ServerB.com,
> the contents of https://ServerA.com get displayed, on the proxy logging
> side, I do see the correct URL https://ServerB.com when the requests coming
> in, but on the backend, I see serverA-local.log records all the activities,
> clearly the traffic has been directed to the wrong Apache virtual host on
> the backend.

Can you please quote the corresponding log entries? Your description is
not specific enough for my pedantic taste.

> Since everything is displayed fine w/o going through proxy
> (i,e: https://ServerB.local & https://ServerA.local displays everything
> fine), I assume something is broken on the Apache proxy?

Looks like it. Can you maybe post your configs again, with as little
editing as possible?

Generally, the only thing you need to make sure is that your ServerNames
match the hostname that you use in your URLs. My guess is that none of
your VirtualHosts matches and Apache just picks the first one as the
default. Maybe it helps to re-read the documentation for name-based
virtual hosting?

http://httpd.apache.org/docs/2.4/vhosts/name-based.html

J.
-- 
Atrocities committed in Rwanda pervade my mind when I am discussing
mundanities with acquaintances.
[Agree]   [Disagree]
                 <http://www.slowlydownward.com/NODATA/data_enter2.html>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web