File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Site Down Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Site Down Page" Watch "Site Down Page" New topic
Author

Site Down Page

Robert Aryan
Greenhorn

Joined: May 08, 2009
Posts: 21
How to show site down page if my app is down for some maintance?
Philip Thamaravelil
Ranch Hand

Joined: Feb 09, 2006
Posts: 99
Hi Robert,
There are lots of ways to accomplish this. You could setup another tomcat instance that contains the site-down page, and simply switch the IP on your firewall to point to this new server instead of the maintenance server.


This will work for planned maint.. for unplanned maint or unexpected tomcat crashes/issues a common practice is to use an http server (such as apache) infront of your app server, then use Mod_JK to connect them.

Hope that helps.
Cheers,
Philip
Robert Aryan
Greenhorn

Joined: May 08, 2009
Posts: 21
Hi Philip

1) First I dont't want to go for another tomcat instance.
2) I try something in .htaccess file but nothing is working like this

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_HOST} !^117\.201\.1\.154
RewriteRule $ /maintenance.html [R=302,L]
Philip Thamaravelil
Ranch Hand

Joined: Feb 09, 2006
Posts: 99
Robert Aryan wrote:Hi Philip

1) First I dont't want to go for another tomcat instance.
2) I try something in .htaccess file but nothing is working like this

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_HOST} !^117\.201\.1\.154
RewriteRule $ /maintenance.html [R=302,L]




The apache instance that is integrated with tomcat doesn't have the same feature set as a standard apache install. So, I wouldn't be suprised if rewrites don't work. The rewrite mod doesn't even come with a full Apache install off the shelf. You have to install the rewrite_mod.

Also, I don't believe this will solve your problem. If Tomcat is taken down, so will the apache server that's integrated with it.

Apache/Tomcat/Mod_JK seems the way to go IMO.

Cheers,
Philip
 
Consider Paul's rocket mass heater.
 
subject: Site Down Page
 
Similar Threads
Crystal reports tutorial
jdiscuss??
cool? OS X idea ?
For Part II and Part II takers
Securing email forms