带有多个 webapp 的 tomcat ajp 连接器
我有一个 tomcat 服务器,带有 webapps/ROOT 应用程序,以 Apache 为前端。
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
我
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
需要向此框中添加第二个 web 应用程序,因此我将其解压到 webapps/pib.war/ 中并更改了 Apache conf:
ProxyPass /pib http://localhost:8009/pib
ProxyPassReverse /pib http://localhost:8009/pib
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
我的 tomcat/conf/server.xml 包含:
<Service name="Catalina">
<Connector port="8009" protocol="AJP/1.3" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase" />
<Host name="localhost" appBase="webapps" />
</Engine>
</Service>
我只有一个 context.xml 文件 - 有webapps 下没有 - 在 conf/context.xml
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
当我访问 https://myserver/ 时,现有的默认 ROOT 应用程序工作正常,但是 https://myserver/pib/ 在catalina.out中给出:
org.apache.jk.common.MsgAjp processHeader
SEVERE: BAD packet signature 18245
intertubes建议的意思是我正在与AJP对话HTTP连接器,而不是 AJP,但第一个 Web 应用程序运行正常。
我缺少什么?我在每个 web 应用程序下都看到了 context.xml 文件的提及,但我不确定它们的用途或要放入其中的内容。
我通常不使用 AJP,但这个盒子已经可以这样工作了,所以我现在有点迷失了。
谢谢,
I have a tomcat server, with a webapps/ROOT application, fronted by Apache.
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
and
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
I need to add a second webapp to this box, so I unpacked it into webapps/pib.war/ and changed the Apache conf:
ProxyPass /pib http://localhost:8009/pib
ProxyPassReverse /pib http://localhost:8009/pib
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
My tomcat/conf/server.xml contains:
<Service name="Catalina">
<Connector port="8009" protocol="AJP/1.3" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase" />
<Host name="localhost" appBase="webapps" />
</Engine>
</Service>
I have only one context.xml file - there are none under the webapps - in conf/context.xml
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
When I visit https://myserver/ then the existing, default, ROOT application works as normal, but https://myserver/pib/ gives, in catalina.out:
org.apache.jk.common.MsgAjp processHeader
SEVERE: BAD packet signature 18245
which the intertubes suggest means I'm talking HTTP to the AJP connector, instead of AJP, yet the first webapp is working properly.
What am I missing? I've seen mention of context.xml files under each webapp, but I'm not sure what they're for or what to put in them.
I don't normally use AJP, but this box is already working that way, so I'm a little lost right now.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论