tomcat ajp connector with multiple webapps

流过昼夜 提交于 2019-12-07 18:21:42

问题


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,

来源:https://stackoverflow.com/questions/7609081/tomcat-ajp-connector-with-multiple-webapps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!