Apache Tomcat上503自定义错误页 [英] apache tomcat 503 custom error page

查看:1666
本文介绍了Apache Tomcat上503自定义错误页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Apache2和tomcat6中端口80上与mod_jk的设定运行(不是从APT仓库,手动下载并安装安装)。在JSP的servlet页面访问浏览器指向 http://myapp.mydomain.com/ (虚拟主机是在Tomcat中(server.xml中)和阿帕奇)来完成。我想Tomcat的错误页面,503重定向到自定义错误页当Tomcat部署期间是下降(pkill的-9 java或/etc/init.d/tomcat停止)。

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.

我的Apache的文档根目录为/ var / WWW /所以我把下面的条目apache2.conf文件

My apache's Document Root is /var/www/ so I place below entry in apache2.conf file

的ErrorDocument 503 maintenance.html 和创建在/ var / WWW文件maintenance.html。当我测试停止Tomcat和我重定向到maintenance.html的页面,而无需在URL改变,但没有显示实际的页面,而不是文件名 maintenance.html 是在浏览器上显示。可以在任何一个可以帮助我正确地配置Apache重定向到正确的maintenance.html页面时,Tomcat是下来了吗?

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 name maintenance.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?.

推荐答案

从的 Apache文档

URLs can begin with a slash (/) for local web-paths (relative to the 
DocumentRoot), or be a full URL which the client can resolve.

我猜的ErrorDocument 503 /maintenance.html 应该工作。

这篇关于Apache Tomcat上503自定义错误页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆