aspose file tools
The moose likes Tomcat and the fly likes Apache loadbalance mod_rewrite mod_proxy Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Apache loadbalance mod_rewrite mod_proxy" Watch "Apache loadbalance mod_rewrite mod_proxy" New topic
Author

Apache loadbalance mod_rewrite mod_proxy

Deyan Sultov
Ranch Hand

Joined: Jul 01, 2002
Posts: 32
Help,
I have added the following lines in Apache's httpd.conf:
<VirtualHost *:80>
ServerName www.myserver.com
RewriteEngine on
RewriteMap server rnd:/rewrite/rproxy.conf
RewriteRule ^/(.*)$ to://${server:web|myserver:8080}/jmx-console
RewriteRule ^to://([^/]+)/(.*) http://$1/$2 [P,L]
RewriteRule .* - [F]
#ProxyRequests On
#ProxyPassReverse / http://myserver:8080/jmx-console/
#ProxyPassReverse / http://otherserver:8080/jmx-console/
#ProxyPassReverse / http://someotherserver:8080/jmx-console/
</VirtualHost>
--------------
rproxy.conf
--------------
www myserver:8080|otherserver:8080|someotherserver:8080

I want:
1. When type in www.myserver.com to be dispatched to one of the the backend servers.
The above mention code works fine. When I type www.myserver.com I received
http://myserver:8080/jmx-console or
http://otherserver:8080/jmx-console or
http://someotherserver:8080/jmx-console
2.The real backend server hostname to be masked to www.myserver.com.
Unfortunately I can not achive this. If uncomment the Proxy directives Apache enters recursion.
http://www.myserver.com - > gets rewrited to http://myserver:8080/jmx-console which is ProxyPassed to http://www.myserver.com .. and so on..
how can I solve this problem
Thanks in advance
[ May 21, 2003: Message edited by: Deyan Sultov ]
[ May 21, 2003: Message edited by: Deyan Sultov ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Apache loadbalance mod_rewrite mod_proxy
 
Similar Threads
client cert authentication problem
need to redirect old URL to new URL
Apache loadbalancing, mod_rewrite, mod_proxy
Apache / Tomcat / SSL / mod_rewrite
Loadbalancing: Apache -> mod_rewrite; session lost