Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer

Just configure your Apache to return appropriate "Sorry, we are performing some maintenance wizardry with a splash of voodoo. We will return shortly." page with Apache's ErrorDocument directive. No restart needed whatsoever - if the backend process does not return some OK http code such as 200, Apache will return the error document page instead.

share|improve this answer

Without Apache restart because of front server downtime? Then you can do a graceful restart with apachectl -k graceful with a change in the config to serve the requests with a static maintenance page.

Else as said before you can have a upstream server which handles all the requests returning maintenance page and you can do a dns based switch.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.