I have a server with multiple domains. Both http (apache) traffic and http-alt (tomcat) traffic.
If/when I take the server down, I'd like to be able to redirect people to a temporary 'undergoing maintenance' page, regardless of their destination URL/port.
How can this be achieved? Do I need tomcat running on the secondary server or is there a way to catch all and redirect via some method I'm not aware of? I've tried simply forcing all 80/8080 traffic to the secondary server, but depending on the URL it doesn't resolve, and it never resolves when trying to access :8080/whatever. Any ideas?
EDIT (update): I have successfully achieved this catch all for any domain and anything port 80 traffic using
_default_ vhost, but it's still not catching anything on 8080, even though I am specifying:
<VirtualHost _default_:*> DocumentRoot /var/www ServerName host ServerAlias * ErrorDocument 404 /index.html </VirtualHost>
Anyone know why or how to?
EDIT (update 2): using tomcat's
in /etc/tomcat/web.xml I added
<error-page> <error-code>404</error-code> <location>/WEB-INF/index.html</location> </error-page>
Any ideas? Thanks