Forum Moderators: phranque
I want to setup a system where I can either load balance my two apache servers. Or, at the very least, if the main server returns an HTTP 500 (JVM down), it should be smart enough to redirect to the same exact page using a different IP address. Is there a way to do that? If so, also, will it rewrite the url to contain the ip address or will it contain the domain name?
This is the code I've tried using in my httpd.conf virtual host block, but it doesnt seem to be doing anything. I just want to make sure Im doing this the correct way.
ErrorDocument 500 [myipaddress...]
[edited by: JeffDrechsler at 4:18 pm (utc) on Sep. 14, 2007]
ErrorDocument 500 /500errorurl.html
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(^\ )*\ HTTP/
RewriteRule ^/500errorurl\.html$ http://otherserverIPaddress/%1 [R=302,L]
However, if a serious problem exists that causes both the JVM and mod_rewrite to fail, this approach is not robust.
Jim