-
1. Re: mod_cluster & AS7 redirect problem
syncmaster2009 Dec 4, 2011 11:24 AM (in response to erhard)Not if it will solve it, but did you try to add the ProxyPreserveHost On to your configuration?
-
2. Re: mod_cluster & AS7 redirect problem
erhard Dec 4, 2011 2:24 PM (in response to syncmaster2009)I didn't try it. Also because I wanted to ask whether this should work out of the box or not. With the AJP protocol and JBoss 4 this worked without further configuration. If the cause is in the HTTP-protocol from mod_cluster to AS7, it might be better to configure AJP to AS7 as well to reduce possible problems. So my question is also about best practices.
-
3. Re: mod_cluster & AS7 redirect problem
rhusar Dec 4, 2011 6:31 PM (in response to erhard)Are you trying the mod_cluster demo? Unfortunately it doesnt work on AS7 as it relies on the stuff removed from AS7.
See https://issues.jboss.org/browse/MODCLUSTER-25
HTH,
Rado
-
4. Re: mod_cluster & AS7 redirect problem
erhard Dec 5, 2011 4:42 PM (in response to rhusar)1 of 1 people found this helpfulNo, just a simple JSP:
./META-INF/MANIFEST.MF
./index.jsp
./WEB-INF/web.xml
with ./WEB-INF/web.xml:
<web-app id="WebApp_ID" version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>test</display-name>
<distributable/>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
...
But it works, when I configure the ajp-connector like this (added to standalone-ha.xml):
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
...
<socket-binding-group name="standard-sockets" default-interface="public">
<socket-binding name="http" port="8080"/>
<socket-binding name="ajp" port="8009"/>
...
and jboss-as-7.1.0.CR1-SNAPSHOT from today.
Greetings
Erhard
-
5. Re: mod_cluster & AS7 redirect problem
erhard Dec 5, 2011 4:53 PM (in response to rhusar)I assume you mean MODCLUSTER-259.
-
6. Re: mod_cluster & AS7 redirect problem
rhusar Dec 14, 2011 7:54 PM (in response to erhard)Haha, correct, I meant that.
-
7. Re: mod_cluster & AS7 redirect problem
rhusar Dec 14, 2011 7:54 PM (in response to erhard)Anyway, does the problem still exist with the latest snapshot?
-
8. Re: mod_cluster & AS7 redirect problem
erhard Dec 15, 2011 4:59 PM (in response to rhusar)I tried 1.1.4-SNAPSHOT from Dec 12.Its the same. I just changed the *.so in httpd. Do I have to change something on AS7 as well?
-
9. Re: mod_cluster & AS7 redirect problem
erhard Jan 13, 2012 9:52 AM (in response to syncmaster2009)When I set ProxyPreserveHost in httpd.conf:
# MOD_CLUSTER_ADDS
# Adjust to you hostname and subnet.
ProxyPreserveHost On
it works:
$ curl -D - http://devjava/demo7
HTTP/1.1 302 Moved Temporarily
Date: Fri, 13 Jan 2012 14:08:06 GMT
Server: Apache-Coyote/1.1
Location: http://devjava/demo7/
Why, is a mystery to me since the Documentation says:
When enabled, this option will pass the Host: line from the incoming request to the proxied host, instead of the hostname specified in the proxypass line. This option should normally be turned
Off
. It is mostly useful in special configurations like proxied mass name-based virtual hosting, where the original Host header needs to be evaluated by the backend server.This solution is also indicated in https://community.jboss.org/thread/154665.
It also woks is using:
# MOD_CLUSTER_ADDS
# Adjust to you hostname and subnet.
ProxyPassReverse / balancer://mycluster
$ curl -D - http://devjava/demo7
HTTP/1.1 302 Moved Temporarily
Date: Fri, 13 Jan 2012 14:17:02 GMT
Server: Apache-Coyote/1.1
Location: http://devjava//demo7/
There are two slash // between host and location, but for me it is more consistent with the documentation:
This directive lets Apache adjust the URL in the
Location
,Content-Location
andURI
headers on HTTP redirect responses. This is essential when Apache is used as a reverse proxy to avoid by-passing the reverse proxy because of HTTP redirects on the backend servers which stay behind the reverse proxy.What doesn't work is the configuration that comes with the mod_cluster download. I think at least this should be fixed. See also https://community.jboss.org/message/556683#556683