• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Apache loadbalance mod_rewrite mod_proxy

Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/
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
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 ]
    Bookmark Topic Watch Topic
  • New Topic