Page tree
Skip to end of metadata
Go to start of metadata
Your Rating: Results: 1 Star2 Star3 Star4 Star5 Star 138 rates


When your application server is down, you'd like to show a nice maintenance page instead of a "server not reachable" error message.


Configure Tomcat (or whatever else you use) to only listen on internal port 8080 and use a packet filter like pf or ipfw to redirect public port 80 to internal port 8080.
Use e.g. lighttpd listening on a different internal port (e.g. 80) for serving
a maintenance page. Create a second ruleset for maintenance mode redirecting
from public port 80 to lighttpd's port. Switch pf rules when doing maintenance.

As an added bonus, add the rule switch to the tomcat startup/shutdown scripts and your maintenance page will show up automatically whenever you shutdown your application server.

(This idea is from Oliver Lietz)