停机时将 tomcat 重定向到维护页面 [英] Redirect tomcat to maintenance page when down

查看:27
本文介绍了停机时将 tomcat 重定向到维护页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ubuntu9.10 和 8.10 服务器上使用带有 mod_jk 设置(都运行在端口 80)的 tomcat6.我在/usr/share/tomcat/webapps 下部署war 文件.在部署过程中,当我重启tomcat时,在浏览器上访问tomcat应用程序时会得到如下页面:

I'm using tomcat6 with mod_jk setup(both running at port 80) on ubuntu9.10 and 8.10 servers. I deploy war files under /usr/share/tomcat/webapps. During deployment, as I restart the tomcat, I will get the following page when the tomcat application is accessed on the browser:

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.2.11 (Ubuntu) mod_jk/1.2.15 Server at 192.168.2.54 Port 80

如何在 tomcat 服务器关闭时将此页面重定向到其他一些自行创建的维护页面?

How could I redirect this page to some other self created maintenance page while the tomcat server is down?.

推荐答案

您可以在 Apache 中为错误代码 503 设置自定义错误页面.

You can setup custom error page in Apache for error code 503.

http://httpd.apache.org/docs/2.2/mod/core.html#errordocument

ErrorDocument 503 /maintance.html

这篇关于停机时将 tomcat 重定向到维护页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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