Hi,
I want to loadbalance several backend servers (
JBoss - Jetty). I also have restriction not to use ajp13(because it can not support SSL protocol). Thats why I use Apache + mod_rewrite + mod_proxy. We have 3 servers:
http://server_one:8080/somecontext/ http://server_two:8080/somecontext/ http://server_tree:8080/somecontext/ The modification in httpd.conf
Listen 80
<VirtualHost _default_:80>
RewriteEngine on
RewriteLog logs/proxy_rewrite.log
RewriteLogLevel 9
RewriteMap server rnd:/conf/rproxy.conf
RewriteRule^(http|https)://.* - [F]
RewriteRule ^/$/somecontext/[R]
RewriteRule ^/(.*)$to://${server:web}/$1
RewriteRule ^to://([^/]+)/(.*)
http://$1/$2 [P,L]
ProxyRequestsOn
ProxyPassReverse /
http://server_one:8080/ ProxyPassReverse /
http://server_two:8080/ ProxyPassReverse /
http://server_tree:8080/ </VirtualHost>
the file rproxy.conf contains:
www server_one:8080|server_two:8080|server_tree:8080
So far, so good. I can access
http://server/ and mod_rewrite randomly chooses one of the servers
ant distributes request to it. It is reverese proxied to
http://server/context, so the end user is not aware for the real name of the server. But the problem is that there is no mechanism like "sticky sessions" provided (like in ajp13), so once I log in.. i the next request I am happily distributed to other server where no session is exported. Can someone help me with any idea on how to overcome this? Is there a mechanism of Session Replication in JBoss. Any suggestions, links, literature.
Thanks in advance.
[ July 11, 2003: Message edited by: Deyan Sultov ]