You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve Cohen <sc...@javactivity.org> on 2011/09/15 14:35:04 UTC

Bad documentation error on Tomcat 6.0 howto site

There is a bad error on the Tomcat 6.0 documentation website:
http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access

They give the 7.0 syntax for manager role names.  6.0 requires 
"manager", not "manager-gui" or "manager-script" and it led astray for 
several hours.

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: mod_proxy_balancer anomaly Question

Posted by Pid <pi...@pidster.com>.
On 15/09/2011 16:18, Shanti Suresh wrote:
> All,
> 
> I am trying to understand some anomaly with mod_proxy and mod_proxy_balancer.  mod_proxy works fine if the (reverse)Proxying is done to the local Tomcat Engine rather than going through the balancer.  If it goes through the "balancer", then an extra "/" is added on 302 Redirects after the hostname in URLs.  Adding "ProxyPreserveHost On" gets the proper 302 Redirects without the extra "/".
> 
> Short of reading source code, I was hoping someone can explain the:
> (1) purpose of "ProxyPreserveHost On"  ->  It is to pass the "Host" header from the incoming request onto Tomcat
> (2) Does "ProxyPreserveHost" have any implication on the "Location:" Header going out in 302 responses?
> (3) I thought the "ProxyPassReverse" directive was used for setting (rewriting) the "Location:" header in the 302 responses.
> (4) How does Tomcat work without "ProxyPreserveHost On" when requests don't go through the balancer?

Please start an entirely new email thread.

Replying to an existing thread, just editing subject & body, is called
thread-hijacking and makes your message appear in the middle of another
conversation in threaded mail readers.


p




Re: mod_proxy_balancer anomaly Question

Posted by André Warnier <aw...@ice-sa.com>.
Shanti Suresh wrote:
> All,
> 
> I am trying to understand some anomaly with mod_proxy and mod_proxy_balancer.  mod_proxy works fine if the (reverse)Proxying is done to the local Tomcat Engine rather than going through the balancer.  If it goes through the "balancer", then an extra "/" is added on 302 Redirects after the hostname in URLs.  Adding "ProxyPreserveHost On" gets the proper 302 Redirects without the extra "/".
> 
> Short of reading source code, I was hoping someone can explain the:

Short answers :

> (1) purpose of "ProxyPreserveHost On"  ->  It is to pass the "Host" header from the incoming request onto Tomcat

Yes. Because the default is that the front-end uses the hostname named in the ProxyPass 
statements, to replace the Host header received from the client.

> (2) Does "ProxyPreserveHost" have any implication on the "Location:" Header going out in 302 responses?

It could have, indirectly, if the Tomcats have virtual hosts themselves.
E.g. : without the "ProxyPreserveHost", the "Host:" header sent to Tomcat will always be 
the one from the ProxyPass directive. So this will always be processed by the same virtual 
host under Tomcat.
With the "ProxyPreserveHost", the "Host" header sent by the client will be left unchanged.
So it could potentially "select" another virtual host within Tomcat, and this virtual host 
within Tomcat may return its 302 "Location" header differently than the virtual host 
mentioned above.
(I cannot think of a good reason why this could happen, but I suppose it could)

> (3) I thought the "ProxyPassReverse" directive was used for setting (rewriting) the "Location:" header in the 302 responses.

It is. And it should only rewrite the hostname part of the value.

> (4) How does Tomcat work without "ProxyPreserveHost On" when requests don't go through the balancer?

It will work fine, thank you. ;-)
Seriously,
at the simplest level, Tomcat doesn't know that it is being proxied to, or balanced, and 
does not know if in Apache httpd there is a ProxyPreserveHost or not.

It gets a HTTP request which contains a Host header.
It tries to match that name with one of its own <Host> tags.
If it finds a match, it dispatches the request to that <Host> within Tomcat.
If it does not find a match, it dispatches the request to its default host, which is the 
<Host> whose name is mentioned in the <Engine> tag.

What would help figuring this out, is
- a copy of the Tomcat's server.xml (edited, remove comments and sensitive info), pasted 
into your next message (this list strips most attachments)
- to know what really creates the 302 Redirect response within Tomcat (and its Location 
header)





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


mod_proxy_balancer anomaly Question

Posted by Shanti Suresh <sh...@umich.edu>.
All,

I am trying to understand some anomaly with mod_proxy and mod_proxy_balancer.  mod_proxy works fine if the (reverse)Proxying is done to the local Tomcat Engine rather than going through the balancer.  If it goes through the "balancer", then an extra "/" is added on 302 Redirects after the hostname in URLs.  Adding "ProxyPreserveHost On" gets the proper 302 Redirects without the extra "/".

Short of reading source code, I was hoping someone can explain the:
(1) purpose of "ProxyPreserveHost On"  ->  It is to pass the "Host" header from the incoming request onto Tomcat
(2) Does "ProxyPreserveHost" have any implication on the "Location:" Header going out in 302 responses?
(3) I thought the "ProxyPassReverse" directive was used for setting (rewriting) the "Location:" header in the 302 responses.
(4) How does Tomcat work without "ProxyPreserveHost On" when requests don't go through the balancer?

Thanks!

            -Shanti

--
Shanti Suresh
shanti@umich.edu
http://lsa.umich.edu/cms






Re: Bad documentation error on Tomcat 6.0 howto site

Posted by Steve Cohen <sc...@javactivity.org>.
On 09/15/2011 08:09 AM, Konstantin Kolinko wrote:
> 2011/9/15 Steve Cohen<sc...@javactivity.org>:
>> 6.0.20.
>
> Yes, it is old...
>
>>   Someone told me that the manager-gui, manager-script stuff was 7.0,
>> I switched it to manager and it worked.  So evidently, this was changed in a
>> later 6.0.x version.  To me, that seems like sort of a major change to make
>> in a minor upgrade version and it should at least be documented.
>
> See changelog, as well as release announcements.
>
>>   Or is the
>> tomcat 6.0 documentation ONLY supposed to cover the latest release?
>
> It covers only the latest release.
> The documentation for the version that you are using is included in
> the download itself (see webapps/docs).
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
ok, thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Bad documentation error on Tomcat 6.0 howto site

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/15 Steve Cohen <sc...@javactivity.org>:
> 6.0.20.

Yes, it is old...

>  Someone told me that the manager-gui, manager-script stuff was 7.0,
> I switched it to manager and it worked.  So evidently, this was changed in a
> later 6.0.x version.  To me, that seems like sort of a major change to make
> in a minor upgrade version and it should at least be documented.

See changelog, as well as release announcements.

>  Or is the
> tomcat 6.0 documentation ONLY supposed to cover the latest release?

It covers only the latest release.
The documentation for the version that you are using is included in
the download itself (see webapps/docs).

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Bad documentation error on Tomcat 6.0 howto site

Posted by Steve Cohen <sc...@javactivity.org>.
On 09/15/2011 07:39 AM, Konstantin Kolinko wrote:
> 2011/9/15 Steve Cohen<sc...@javactivity.org>:
>> There is a bad error on the Tomcat 6.0 documentation website:
>> http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access
>>
>> They give the 7.0 syntax for manager role names.  6.0 requires "manager",
>> not "manager-gui" or "manager-script" and it led astray for several hours.
>
> The documentation is correct.
> You are probably using an old version of Tomcat 6 (and you are not
> telling us which one).
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
6.0.20.  Someone told me that the manager-gui, manager-script stuff was 
7.0, I switched it to manager and it worked.  So evidently, this was 
changed in a later 6.0.x version.  To me, that seems like sort of a 
major change to make in a minor upgrade version and it should at least 
be documented.  Or is the tomcat 6.0 documentation ONLY supposed to 
cover the latest release?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Bad documentation error on Tomcat 6.0 howto site

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/15 Steve Cohen <sc...@javactivity.org>:
> There is a bad error on the Tomcat 6.0 documentation website:
> http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access
>
> They give the 7.0 syntax for manager role names.  6.0 requires "manager",
> not "manager-gui" or "manager-script" and it led astray for several hours.

The documentation is correct.
You are probably using an old version of Tomcat 6 (and you are not
telling us which one).

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org