我使用 mod_jk 设置在端口 80 上运行 apache2 和 tomcat6(不是从 apt 存储库安装,而是手动下载并安装)。通过浏览器访问 jsp servlet 页面http://myapp.mydomain.com/(虚拟主机是在 tomcat(server.xml) 和 apache 中完成的)。当部署期间 tomcat 关闭(pkill -9 java 或 /etc/init.d/tomcat stop)时,我尝试将 tomcat 的错误页面 503 重定向到自定义错误页面。
我的 apache 的文档根目录是 /var/www/ 所以我将以下条目放在 apache2.conf 文件中
ErrorDocument 503 maintenance.html
并在/var/www下创建了一个文件maintenance.html。当我测试停止tomcat时,我将页面重定向到maintenance.html,而没有更改url,但实际页面没有显示,而是显示文件名maintenance.html
显示在浏览器上。任何人都可以帮助我正确配置 apache,使其在 tomcat 关闭时重定向到正确的maintenance.html 页面吗?
来自阿帕奇文档,
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
应该管用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)