The mystery to me is why there is a shm.file entry in jk2.properties...when the actual entry seems to need to be in workers2.properties. The documentation is very sparse in this area.
Rick Bullotta CTO Lighthammer Software (http://www.lighthammer.com) -----Original Message----- From: Andy Eastham [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 12:32 PM To: Tomcat Users List Subject: RE: Problems configuring Tomcat with Apache using mod_jk2 David, This looks like jk config to me, not jk2. If it helps, here are my working config files for apache 2 and mod_jk2 on solaris. (The workers.properties file is called workers2.properties on my system, which is the default name). My Httpd mapping looks like: <VirtualHost *> ServerName 192.168.0.102 ServerAlias www ServerAlias localhost ServerAdmin [EMAIL PROTECTED] DocumentRoot /usr/local/apache2/htdocs ErrorLog logs/home.net-errorlog CustomLog logs/home.net-access.log common <Location "/control/"> JkUriSet worker ajp13:localhost:8009 </Location> <Location "/wwwsadmin/"> JkUriSet worker ajp13:localhost:8009 </Location> </VirtualHost> workers2.properties looks like: [logger.apache2] level=DEBUG [shm] file=/usr/local/apache2/logs/shm.file size=1048576 # Example socket channel, override port and host. [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # define the worker [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # Uri mapping [uri:192.168.0.102/control/*] worker=ajp13:localhost:8009 [uri:localhost/control/*] worker=ajp13:localhost:8009 [uri:wwws/control/] worker=ajp13:localhost:8009 [uri:127.0.0.1/control/*] worker=ajp13:localhost:8009 [uri:192.168.0.102/wwwsadmin/*] worker=ajp13:localhost:8009 [uri:localhost/wwwsadmin/*] worker=ajp13:localhost:8009 [uri:wwws/wwwsadmin/] worker=ajp13:localhost:8009 [uri:127.0.0.1/wwwsadmin/*] worker=ajp13:localhost:8009 Here's /usr/local/tomcat/conf/jk2.properties (note only 2 uncommented lines) ## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED ## WHEN YOU EDIT THE FILE. ## COMMENTS WILL BE _LOST_ ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc. # Set the desired handler list handler.listchannelSocket,request # # Override the default port for the socketChannel channelSocket.port=8009 # Default: # channelUnix.file=${jkHome}/work/jk2.socket # Just to check if the the config is working # shm.file=${jkHome}/work/jk2.shm # In order to enable jni use any channelJni directive # channelJni.disabled = 0 # And one of the following directives: # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so # If set to inprocess the mod_jk2 will Register natives itself # This will enable the starting of the Tomcat from mod_jk2 #apr.jniModeSo=inprocess Finally, server.xml: <Server port="8005" shutdown="SHUTDOWN" debug="0"> <!-- Define an Apache-Connector Service --> <Service name="Tomcat-Apache"> <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8009" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/> <Engine name="Apache" defaultHost="192.168.0.102" debug="0"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="apache_log." suffix=".txt" timestamp="true"/> <!-- Access log processes all requests for this virtual host. --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> <Host name="192.168.0.102" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Alias>localhost</Alias> <Alias>wwws</Alias> <Alias>127.0.0.1</Alias> <Context path="control" docBase="" debug="1"/> <Context path="wwwsadmin" docBase="" debug="1"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="home_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> </Host> </Engine> </Service> I've found the key is to follow and check the path for each mapping in httpd.conf through workers2.properties and then through server.xml. Make sure there's a match for each alias, and make sure you get all the IP addresses right. You don't get much help from any error messages if you get this wrong. Hope this helps - it took me a while to get it all working, but now it works a treat and is very reliable. Andy > -----Original Message----- > From: David Godfrey [mailto:[EMAIL PROTECTED] > Sent: 04 March 2003 17:02 > To: 'Tomcat Users List' > Subject: RE: Problems configuring Tomcat with Apache using mod_jk2 > > > >It would help if you post the entries you added in httpd.conf for > >Tomcat. > Also include your server.xml file for more information. > > I have modified httpd.conf as follows: > > JKWorkersFile "/opt/tomcat/conf/jk/workers.properties" > JKLogFile "/opt/tomcat/logs/mod)jk.log" > Include /opt/tomcat/conf/auto/mod_jk.conf > > Server.xml is as follows (standard apart from the references to > mod_jk) > > <Server port="8005" shutdown="SHUTDOWN" debug="0"> > <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" > modJk="/opt/apache/modules/mod_jk-2.0.43.so" /> > <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" > debug="0"/> > <Listener > className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" > debug="0"/> > <GlobalNamingResources> > <Environment name="simpleValue" type="java.lang.Integer" value="30"/> > <Resource name="UserDatabase" auth="Container" > type="org.apache.catalina.UserDatabase" > description="User database that can be updated and saved"> > </Resource> > <ResourceParams name="UserDatabase"> > <parameter> > <name>factory</name> > <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value> > </parameter> > <parameter> > <name>pathname</name> > <value>conf/tomcat-users.xml</value> > </parameter> > </ResourceParams> > </GlobalNamingResources> > <Service name="Tomcat-Standalone"> > <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" > port="8080" minProcessors="5" maxProcessors="75" > enableLookups="true" redirectPort="8443" > acceptCount="100" debug="0" connectionTimeout="20000" > useURIValidationHack="false" disableUploadTimeout="true" /> > <!-- Define the default virtual host --> > <Host name="localhost" debug="0" appBase="webapps" > unpackWARs="true" autoDeploy="true"> > <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" > append="true" forwardAll="false" > modJk="/opt/apache/modules/mod_jk-2.0.43.so" /> > <Logger className="org.apache.catalina.logger.FileLogger" > directory="logs" prefix="localhost_log." suffix=".txt" > timestamp="true"/> > <Context path="/examples" docBase="examples" debug="0" > reloadable="true" crossContext="true"> > <Logger className="org.apache.catalina.logger.FileLogger" > prefix="localhost_examples_log." suffix=".txt" > timestamp="true"/> > <Ejb name="ejb/EmplRecord" type="Entity" > home="com.wombat.empl.EmployeeRecordHome" > remote="com.wombat.empl.EmployeeRecord"/> > <Environment name="maxExemptions" type="java.lang.Integer" > value="15"/> > <Parameter name="context.param.name" value="context.param.value" > override="false"/> > <Resource name="jdbc/EmployeeAppDb" auth="SERVLET" > type="javax.sql.DataSource"/> > <ResourceParams name="jdbc/EmployeeAppDb"> > <parameter><name>username</name><value>sa</value></parameter> > <parameter><name>password</name><value></value></parameter> > <parameter><name>driverClassName</name> > <value>org.hsql.jdbcDriver</value></parameter> > <parameter><name>url</name> > <value>jdbc:HypersonicSQL:database</value></parameter> > </ResourceParams> > <Resource name="mail/Session" auth="Container" > type="javax.mail.Session"/> > <ResourceParams name="mail/Session"> > <parameter> > <name>mail.smtp.host</name> > <value>localhost</value> > </parameter> > </ResourceParams> > <ResourceLink name="linkToGlobalResource" > global="simpleValue" > type="java.lang.Integer"/> > </Context> > </Host> > </Engine> > </Service> > </Server> > > > Many thanks, > > David > > > > > > -----Original Message----- > From: Ben Ricker [mailto:[EMAIL PROTECTED] > Sent: 04 March 2003 16:37 > To: '[EMAIL PROTECTED]' > Subject: Re: Problems configuring Tomcat with Apache using mod_jk2 > > > You need to JkMount the /examples in httpd.conf. Something like > "JkMount */examples blah" where "blah" is the name of your > loadbalancer setup in workers.properties. > > It would help if you post the entries you added in httpd.conf for > Tomcat. Also include your server.xml file for more information. > > Ben Ricker > > On Tue, 2003-03-04 at 10:36, David Godfrey wrote: > > Hi, > > > > I'm having problems when trying to use Tomcat and Apache HTTP server > > together, with mod_jk2. I have built Apache from the source, > > installed Tomcat 4.1.18, and tested each individually (they seem to > > function correctly). When I add in mod_jk2, both Apache and Tomcat > > still start and function correctly, but there does not appear to be > > any redirection taking place, (I can access > > http://localhost:8080/examples for, but not > > http://localhost/examples). > > > > When I examine "error_log" in APACHE_HOME/logs, there are the > > following 2 entries, but nothing that (to me) indicates an error: > > > > Apache/2.0.43 (Unix) mod_jk/1.2.1 configured -- resuming normal > > operations > > > > File does not exist: /opt/apache/htdocs/examples > > > > The error/log file I have defined in httpd.conf for mod_jk2 is > > created when I start Apache / Tomcat, but is empty. I am running > > Solaris 2.8, Apache 2.0.43, Tomcat 4.1.18, and Java 1.4.1. > > > > I would really appreciate some ideas on how I could solve this > > problem. > > > > Many thanks, > > > > D > > > > -------------------------------------------------------------------- > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > -- > Ben Ricker <[EMAIL PROTECTED]> > Wellinx.com > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
