In a Windows Server 2008 R2, I have installed Apache Tomcat and there I deploy my web apps. When I want to update my web apps, I stop the service (of Tomcat server), I update the the webapp folder with the new war files and then I start again the service.

I have created a static page ("Under maintenance, please wait"), which I want to show to the user in case he tries to visit the webapp application at that moment.

Is there a way to show this static page, during the time when the server is down?


If you expose Tomcat directly to the user, you can't do that. In this configuration is Tomcat that is listening in the port 80, if Tomcat is down you can't produce any temporary response because your server is unreachable.

Instead, (and this is also a good practice) you should put a web server before Tomcat (for example Apache or Nginx). In this way you can redirect a request to a static page when your tomcat is down.

A professional (and not) website architecture, should never and never expose directly Tomcat, also for security reasons.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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