Using Apache with Tomcat


In some architectures, it is useful to put an Apache web server in front of the JBoss server. External web clients talk to an Apache instance, which in turn speaks to the Tomcat instance on behalf of the clients. Apache needs to be configured to use the mod_jk module, which speaks the AJP protocol to an AJP connector running in Tomcat. The provided server.xml file comes with this AJP connector enabled:

 <Connector port="8009" address="${jboss.bind.address}"            enableLookups="false" redirectPort="8443" debug="0"            protocol="AJP/1.3" /> 

You need to consult the Apache and mod_jk documentation for complete installation instructions. Assuming that you have a properly configured Apache instance, the following configuration fragment shows an example of how to connect with a WAR deployed with a context root of /jbosstest:

 ... LoadModule jk_module libexec/mod_jk.so AddModule mod_jk.c <IfModule mod_jk.c>     JkWorkersFile /tmp/workers.properties     JkLogFile /tmp/mod_jk.log     JkLogLevel debug     JkMount /jbosstest/* ajp13 </IfModule> 

The workers.properties file contains the details of how to contact the JBoss instance.



JBoss 4. 0(c) The Official Guide
JBoss 4.0 - The Official Guide
ISBN: B003D7JU58
EAN: N/A
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net