Tomcat – Answering all requests with a maintenance page without restarting Apache HTTP server

apache-2.2maintenancemod-jktomcat

let say we have the following picture:

A Apache HTTP server is serving the users' requests. It forwards all (or a part of) requests to a Tomcat server using mod_jk.

Let's say we want to shutdown our application on Tomcat for two hours for maintenance. And we want that all users that access the application get a message about the maintence (Like: sorry, we are maintaining our servers. The app will be online again at 6 a.m.).

Is there a way to put this maintenance page online without restarting the Apache HTTP server? (The server can not be restarting because it is serving other applications)

Thanks

Best Answer

Setup another Tomcat instance that just displays the maintenance page. Run it instead of your application Tomcat.

BTW you can gracefully restart the Apache HTTP server which recycles each thread serving requests once each thread has finished it's current request, so no requests are dropped.

Related Topic