-
1. Re: Jboss 7, mod_cluster and PrettyFaces
rhusar Aug 24, 2011 4:22 AM (in response to ssachtleben)1 of 1 people found this helpfulHi Sebastian, let me look at #1:
1) The method getRemoteAddr() from HttpServletRequest returns the server ip instead of the client ip. How do I retrieve the client ip with mod_cluster?
You should look at what are you doing with that method, see javadoc:
http://download.oracle.com/javaee/1.4/api/javax/servlet/ServletRequest.html#getRemoteAddr%28%29
It clearly says:
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets, same as the value of the CGI variable
REMOTE_ADDR
.This means you are geetting the IP of the proxy. So for the client you would need to look for a header similar to "
x-forwarded-for" or so, not sure what the exact header is.
Rado
-
2. Re: Jboss 7, mod_cluster and PrettyFaces
ssachtleben Aug 24, 2011 7:00 AM (in response to rhusar)Thanks Radoslav. Sounds fair enough.
request.getHeader("x-forwarded-for") has the value
But still having the double slash problem...
-
3. Re: Jboss 7, mod_cluster and PrettyFaces
pferraro Aug 24, 2011 10:14 AM (in response to ssachtleben)Let's see if Jean-Frederic has any insight into the double slash issue.
-
4. Re: Jboss 7, mod_cluster and PrettyFaces
jfclere Aug 24, 2011 11:19 AM (in response to pferraro)- ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
- ProxyPassReverse / balancer://mycluster
Do you really need those mod_proxy directives? May be that is the problem.
-
5. Re: Jboss 7, mod_cluster and PrettyFaces
ssachtleben Aug 24, 2011 2:24 PM (in response to jfclere)As I said before I need several vhosts to provide static content and I just want the jboss cluster in one vhost. Here is my full configuration:
CreateBalancers 1
UseAlias 0
# MOD_CLUSTER_ADDS
# Adjust to you hostname and subnet.
<IfModule manager_module>
Listen 127.0.0.1:6666
ManagerBalancerName mycluster
<VirtualHost 127.0.0.1:6666>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
ServerAdvertise On
<Location />
Order deny,allow
Allow from All
</Location>
</VirtualHost>
</IfModule>
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin info@domain.com
ServerName domain
ServerAlias www.domain.de www.domain.com
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster
<Location />
Order deny,allow
Allow from All
</Location>
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from 127.0.0
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@domain.de
ServerName static.domain.de
ServerAlias static.domain.de
DocumentRoot /PRODUCTION/repository/domain/workspace
<Directory /PRODUCTION/repository/domain/workspace/>
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
ErrorLog "/PRODUCTION/mod_cluster-1.1.3.Final/httpd/logs/error.log"
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog "/PRODUCTION/mod_cluster-1.1.3.Final/httpd/logs/access.log" combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@domain.com
ServerName static.domain.com
ServerAlias static.domain.com
DocumentRoot /PRODUCTION/repository/domain/workspace
<Directory /PRODUCTION/repository/domain/workspace/>
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
ErrorLog "/PRODUCTION/mod_cluster-1.1.3.Final/httpd/logs/error.log"
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog "/PRODUCTION/mod_cluster-1.1.3.Final/httpd/logs/access.log" combined
</VirtualHost>
I have tried to comment out ProxyPassReverse but then the redirect will be end in serverip:8088/requested.html (jboss port directly).
It seems like:
externalContext.redirect("/requested.html");
result in:
domain//requested.html
Any ideas?
-
6. Re: Jboss 7, mod_cluster and PrettyFaces
ssachtleben Aug 24, 2011 4:58 PM (in response to ssachtleben)I have fixed it with changing configuration to:
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost On
Now everything seems fine
-
7. Re: Jboss 7, mod_cluster and PrettyFaces
jfclere Aug 25, 2011 4:41 AM (in response to ssachtleben)It seems the ProxyPassReverse / balancer://mycluster is creating the problem.
-
8. Re: Jboss 7, mod_cluster and PrettyFaces
ssachtleben Aug 25, 2011 4:52 AM (in response to jfclere)Should I raise a jira issue?
I think it should work without ProxyPreserveHost also or am I wrong?
-
9. Re: Jboss 7, mod_cluster and PrettyFaces
jfclere Aug 25, 2011 5:46 AM (in response to ssachtleben)I have created MODCLUSTER-250
-
10. Re: Jboss 7, mod_cluster and PrettyFaces
ssachtleben Aug 25, 2011 6:47 AM (in response to jfclere)Thanks!!!