jQuery in Action, 3rd edition
The moose likes Tomcat and the fly likes Apache web server tomcat : Connector protocol conflict Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache web server tomcat : Connector protocol conflict" Watch "Apache web server tomcat : Connector protocol conflict" New topic

Apache web server tomcat : Connector protocol conflict

Kim Ming Yap
Ranch Hand

Joined: Dec 17, 2008
Posts: 53

There's something i dont quite understand as shown below:

a. Apache web server httpd.conf

ProxyPass /cgi-qa-axis-rt/ ajp://localhost:8988/cgi-qa-axis-rt/
ProxyPassReverse /cgi-qa-axis-rt/ ajp://localhost:8988/cgi-qa-axis-rt/

b. On the cgi-qa-axis-rt context, the server.xml is as follows:

<!-- -->
<Connector executor="tomcatThreadPool"
port="8988" protocol="HTTP/1.1"
redirectPort="8443" />

<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />

<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--Connector port="8888" protocol="AJP/1.3" redirectPort="8443" connectionTimeout="3000000" keepAliveTimeout="3000000" /-->

Apache web server will transfer the request to cgi-qa-axis-rt using ajp protocol. In cgi-qa-axis-rt server.xml, this ajp connector port is commented out. In cgi-qa-axis-rt server.xml, port 8988 is using HTTP protocol.
Why does it work?
Apache managed to transfer request to cgi-qa-axis-rt.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20276

As far as I can tell, ProxyPass forwards the request to port 8988 - the HTTP connector, not the AJP connector. So it doesn't look so strange to me.

How To Ask Questions How To Answer Questions
Kim Ming Yap
Ranch Hand

Joined: Dec 17, 2008
Posts: 53

The proxypass statements, if you read carefully:

ProxyPass /cgi-qa-axis-rt/ ajp://localhost:8988/cgi-qa-axis-rt/

it is mapping /cgi-qa-axis-rt/ to localhost:8988/cgi-qa-axis-rt/ using ajp protocol. So it is not using HTTP in this statements. This statement is in apache web server httpd.conf.

However the tomcat server.xml for cgi-qa-axis-rt context in localhost is defined with HTTP connector for port 8988. The AJP connector has been commented out.

It still works. That's what puzzles me.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

I would check to see if you have 2 copies of Tomcat running, then. Because either your proxy definition isn't the one being used, or something is out there listening and responding on port 8988. Unless an application opens a port, attempts to communicate with that port will bounce.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link: http://aspose.com/file-tools
subject: Apache web server tomcat : Connector protocol conflict
jQuery in Action, 3rd edition