apache tomcat 503 custom error page
From the apache documentation,
URLs can begin with a slash (/) for local web-paths (relative to the
DocumentRoot), or be a full URL which the client can resolve.
I guess ErrorDocument 503 /maintenance.html
should work.
user465465
Updated on June 30, 2022Comments
-
user465465 almost 2 years
I have apache2 and tomcat6(not installed from apt repository, manually downloaded and installed) running on port 80 with mod_jk setup. The jsp servlet pages are accessed pointing the browser to http://myapp.mydomain.com/ (virtual hosting is done in tomcat(server.xml) and in apache). I'm trying to redirect tomcat's error page 503 to custom error page when tomcat is down(pkill -9 java or /etc/init.d/tomcat stop) during deployment.
My apache's Document Root is /var/www/ so I place below entry in apache2.conf file
ErrorDocument 503 maintenance.html
and created a file maintenance.html under /var/www. When I tested stopping the tomcat and I got the page redirected to maintenance.html without having the url changed but the actual page is not displayed, instead the file namemaintenance.html
is displayed on the browser. Could any one help me properly configuring apache that redirects to proper maintenance.html page when tomcat is down?. -
user465465 over 13 yearsIn the
/etc/apache2/sites-enabled/000-defaults
file the DocumentRoot is/var/www/
instead/var/www
. If I use/maintenance.html
insteadmaintenance.html
I'll get the sameServer Temporarly Unavailable
error page. -
user465465 over 13 yearsLike server-ip/maintenance.html works and I can add
ErrorDocument 503 http://server-ip/maintenance.html
in the apache config file and this works but the page stays in the maintenance page and the user again have to point the url to myapp.mydomain.com after the tomcat is up. -
Raghuram over 13 yearsFrom apache docs (httpd.apache.org/docs/2.0/mod/core.html#documentroot), The DocumentRoot should be specified without a trailing slash. Good luck to you!
-
Raghuram over 13 yearsmaintenance.html can contain a clickable link to your app or a periodic meta refresh to it.
-
user465465 over 13 yearsIt's just a normal html program and there is nothing like that as it is created by me.