使用 mod_jk 让 apache 默认为特定 JKMount 时出现问题
我有一个 apache 实例,前面有 4 个 tomcat web 应用程序,我们称它们为 app1、app2、app3、app4。我使用 mod_jk 充当连接器,并且我已经为每个 Apache 设置了 JKMount 条目,我可以愉快地点击:
server:8080/app1
server:8080/app2
server:8080/app3
server:8080/app4
但是什么我实际上想要的是让 app1、app2 和 app3 的所有流量都按照上面的方式进行处理,但是 app4 (仅)在以下位置处理:
server:8080/
我确信这会很容易,但我无法想象出去。有什么想法吗?
戈登
I have an apache instance fronting 4 tomcat webapps, lets call them app1, app2, app3, app4. I'm using mod_jk to act as the connector and I've set up apache with JKMount entries for each and I can happily hit:
server:8080/app1
server:8080/app2
server:8080/app3
server:8080/app4
But what i actually want is to have all the traffic for app1, app2 and app3 be addressed as above, but with app4 (only) addressed on:
server:8080/
I was sure this was going to be easy, but i can't figure it out. Any ideas?
Gordon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我理解正确,您想要将 app4 设置为默认 Web 应用程序 - 以便它可以直接作为 server:8080/ 使用,
您需要做的就是将路径设置为
""
Tomcat 上server.xml
中
内的Context
元素。。这应该可以
从 Tomcat 文档中得到,
确保重新启动 Apache 和 Tomcat 一次以启用更改。
注意:来自 Tomcat 6 文档 http://tomcat.apache .org/tomcat-6.0-doc/config/context.html#Introduction 建议不要将其放入 server.xml 中,因为任何更改都需要重新启动 Tomcat。
但我自己还没有尝试过该选项。
If I understand correctly, you want to set app4 as the default web app - so that it will be available directly as server:8080/
all you need to do is you can set the path as
""
in aContext
element within<Host>
inserver.xml
on Tomcat.. This should work
From the Tomcat docs,
Ensure you restart Apache and Tomcat once to enable the changes.
Note: From the Tomcat 6 docs http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Introduction it is recommended not to put this in server.xml since you need to restart Tomcat for any changes.
but i have not tried that option myself.
从 Tomcat 5.5 开始(我不知道早期版本),您可以将 app4 重命名为 ROOT.war(如果它是 WAR 文件)或 ROOT/(如果它是目录)。从逻辑上讲,您必须覆盖任何现有的 ROOT.war 或 ROOT/(如果存在)。
As of Tomcat 5.5 (I don't know about earlier versions) you can rename app4 to ROOT.war if it's a WAR file or ROOT/ if it's a directory. Logically you will have to overwrite any existing ROOT.war or ROOT/ if there is one present.