• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
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 ]
 
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic