You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by mi...@thomson.com on 2006/09/12 08:42:35 UTC

Apache2, Tomcat, and connectors

I have separate web and app servers.  They are both behind a firewall
and I only have port 80 access to the web server and ssh to each of the
servers.  I'm attempting to set up a development environment where we
can eventually add more app servers and add load balancing to provide an
environment where we can debug load balancing issues.

I'd like to set up several developers with their own development
environments (tomcat, and their apps) on the app server.  I've tried
reverse proxy, mod_jk, and mod_proxy_ajp without complete success.

I just can't believe I'm the first to try this, but I've searched
everywhere I can imagine looking for sample configurations and haven't
found the answer.  I cannot figure out how to do this without virtual
hosts, and remember I only have one domain name and one port to the web
server.

So, which is the current 'best practice' among reverse proxy, mod_jk,
and mod_proxy_ajp?  Can I get multiple Tomcats running on the app server
with the same Apache2 connecting via one of the connectors mentioned
above?

Any guidance is appreciated.

Here's the applicable part of my config files:

Apache2-----------------

	.
	.
	.
ProxyRequests Off
<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>
JkLogFile        /var/log/httpd.mod_jk.log
JkLogLevel       debug
JkLogLevel       info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions        +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat     "%b %H %m %v:%p %q %r %s %U %w %V %T"
JkWorkerProperty worker.list=3Dtomcat,mrjwrkr JkWorkerProperty
worker.tomcat.type=3Dajp13 JkWorkerProperty
worker.tomcat.host=3Dmydomain.com JkWorkerProperty
worker.tomcat.port=3D8009 JkWorkerProperty worker.mrjwrkr.type=3Dajp13
JkWorkerProperty worker.mrjwrkr.host=3Dmydomain.com
JkWorkerProperty worker.mrjwrkr.port=3D50011 <Location /dev/user1/>
  # These work, more or less; can get to index.jsp->manager but then
broken
  ProxyPass             http://mydomain.com:50012/dev/user1/
  ProxyPassReverse      http://mydomain.com:50012/dev/user1/
  # These work, more or less; can get to index.jsp->manager but then
broken
  #ProxyPass            ajp://mydomain.com:50011/dev/user1/
  #ProxyPassReverse     ajp://mydomain.com:50011/dev/user1/
  # This doesn't work at all
  #JkMount              mrjwrkr
</Location>
	.
	.
	.

Tomcat------------------

	.
	.
	.
    <!-- Define an AJP 1.3 Connector on port 50011 -->
    <Connector port=3D"50011" URIEncoding=3D"UTF-8"
               enableLookups=3D"false" redirectPort=3D"50013"
protocol=3D"AJP/1.3" />

    <!-- Define a non-SSL HTTP/1.1 Connector on port 50012 -->
    <Connector port=3D"50012" maxHttpHeaderSize=3D"8192" =
URIEncoding=3D"UTF-8"
               maxThreads=3D"150" minSpareThreads=3D"25"
maxSpareThreads=3D"75"
               enableLookups=3D"false" redirectPort=3D"50013"
acceptCount=3D"100"

    <Engine name=3D"Catalina" defaultHost=3D"localhost" =
jvmRoute=3D"mrjwrkr">
	.
	.
	.

----------------------------------------
Michael R. Jordan
Thomson Learning Solutions
20 Davis Drive
Belmont, CA  94002

+1 650 413 7431

www.thomson.com/learning

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Apache2, Tomcat, and connectors

Posted by Hassan Schroeder <ha...@gmail.com>.
On 9/11/06, michael.r.jordan@thomson.com <mi...@thomson.com> wrote:

> I'd like to set up several developers with their own development
> environments (tomcat, and their apps) on the app server.

I'm not sure why this seems difficult, but maybe I don't understand
fully what you want to do :-)  In any case --

You have one app server, so you create a Tomcat instance for each
of Fred, Gina, and Bob. The instances have AJP connectors listening
on, respectively, ports 9001, 9101, 9201.

Then your balancer cluster looks something like:

<Proxy balancer://mytestcluster>
  BalancerMember ajp://testbox:9001 smax=10 loadfactor=10 route=TEST01
  BalancerMember ajp://testbox:9101 smax=10 loadfactor=10 route=TEST02
  BalancerMember ajp://testbox:9201 smax=10 loadfactor=10 route=TEST03
</Proxy>

This assumes using mod_proxy_ajp, because I've set that up for a
client recently, and haven't used mod_jk in years.  :-)

Anyway, does that address your use case?

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org