3

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,

woddle
  • 1,582
  • 1
  • 18
  • 34
  • 3
    Why did you add the second application (pib) with `http` protocol in Apache proxy directives (`ProxyPass`/`ProxyPassReverse`) instead of `ajp`? – ivantod Sep 30 '11 at 11:23
  • do you need to add the other one? Doesnt the first take care of forwarding everything to tomcat? i am not very sure hence the question... – sethu Sep 30 '11 at 13:22
  • 1
    ivantod: oh, dear, spot on. I stared and stared at those lines and didn't see that. How embarrassing. Thank you. I had changed it from AJP connector to HTTP connector and it was all working, now I can go back to AJP. *shamefaced* – woddle Sep 30 '11 at 13:46

0 Answers0