Problems configuring Tomcat with Apache using mod_jk2
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]
RE: Problems configuring Tomcat with Apache using mod_jk2
Can you search archive? My bet is you didn't define [uri] in your workers2.properties. -Original Message- From: David Godfrey [mailto:[EMAIL PROTECTED] Sent: March 4, 2003 11:36 AM To: '[EMAIL PROTECTED]' Subject: Problems configuring Tomcat with Apache using mod_jk2 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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]
RE: Problems configuring Tomcat with Apache using mod_jk2
David, I am confused. You said you use jk2. But in your log, I can only see mod_jk resuming normal operations while it should be mod_jk2/2.0.3-dev configured -- resume.. if you use jk2. -Original Message- From: Ben Ricker [mailto:[EMAIL PROTECTED] Sent: March 4, 2003 11:37 AM 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]
Re: Problems configuring Tomcat with Apache using mod_jk2
On Tue, 2003-03-04 at 10:36, Ben Ricker wrote: 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. Let me correct that: it should be '/examples/* blah'. I was looking at two different entries in my own httpd.conf. Ben Ricker 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]
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 namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/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=2 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 parameternameusername/namevaluesa/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueorg.hsql.jdbcDriver/value/parameter parameternameurl/name valuejdbc:HypersonicSQL:database/value/parameter /ResourceParams Resource name=mail/Session auth=Container type=javax.mail.Session/ ResourceParams name=mail/Session parameter namemail.smtp.host/name valuelocalhost/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
Re: Problems configuring Tomcat with Apache using mod_jk2
Actually, mod_jk2 does not use JKMount . . . . In workers2.properties you might have a configuration that reads: # Uri mapping [uri:/examples/*.jsp] worker=ajp13:localhost:8009 Now this is really pointing to: $TOMCAT_HOME/webapps/examples Most of the time, the absolute directory is outside of your document home for the Apache web server. You can handle this with a directory alias in the httpd.conf file. Something like: Alias /examples/ /opt/tomcat/webapps/examples/ will work. Just substitute your directory location for the one in the above line. These two snippets (from workers2.properties and httpd.conf) will let Apache serve everything except the files ending in .jsp. That will be handed off to Tomcat. To include the servlets under the examples directory, add the following to your workers2.properties file. [uri:/examples/servlet/*] worker=ajp13:localhost:8009 This will get all of the servlets in the examples webapp, while still allowing Apache to serve static content. There are some more configuration changes that you should do, like denying access to the WEB-INF directory, and configuring the properties of the actual application directory. Most of that is detailed in the Apache web server documentation. I'm just a user/sysadmin/developer and not a member of any Apache group, so this is just based on my experience and the reading of the documentation. HTH /mde/ just my two cents . . . . __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems configuring Tomcat with Apache using mod_jk2
On Tue, 2003-03-04 at 11:01, David Godfrey wrote: 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 Just to be sure, tack on the mod_jk.conf. It still looks like you have an issue with telling Apache where to go for /examples and any other webapps (like /manager or /admin). You need to add the JkMount directives in httpd.conf; they are sort of like redirects in that they tell Apache to send requests for, say, /examples/* to the available worker(s). My entry in httpd.conf for /examples: JkMount /examples/* loadbalancer loadbalancer is defined in my workers.properties file. For example, I have the follwoing in my workers.properties: worker.list=tomcat1,tomcat2,loadbalancer # # First tomcat server # worker.tomcat1.port=11009 worker.tomcat1.host=127.0.0.1 worker.tomcat1.type=ajp13 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=tomcat1,tomcat2 Ben Ricker 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 namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/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=2 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 parameternameusername/namevaluesa/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueorg.hsql.jdbcDriver/value/parameter parameternameurl/name valuejdbc:HypersonicSQL:database/value/parameter /ResourceParams Resource name=mail/Session auth=Container type=javax.mail.Session/ ResourceParams name=mail/Session parameter namemail.smtp.host/name valuelocalhost/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
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=2 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 Aliaslocalhost/Alias Aliaswwws/Alias Alias127.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
RE: Problems configuring Tomcat with Apache using mod_jk2
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=2 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 Aliaslocalhost/Alias Aliaswwws/Alias Alias127.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
RE: Problems configuring Tomcat with Apache using mod_jk2
Rick, That's a leftover from the file on the web I copied my config from - it's commented out anyway. I haven't a clue what it does. All I know is that this set up works! Andy -Original Message- From: Rick Bullotta [mailto:[EMAIL PROTECTED] Sent: 04 March 2003 18:11 To: 'Tomcat Users List' Subject: RE: Problems configuring Tomcat with Apache using mod_jk2 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=2 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 Aliaslocalhost/Alias Aliaswwws/Alias Alias127.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
RE: Problems configuring Tomcat with Apache using mod_jk2
Actually, fear not, the cause of the mystery wasn't you g. The sample files in the docs include this strange entry as well. I agree that when ya find something that works, best not to f with it. -Original Message- From: Andy Eastham [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 3:49 PM To: Tomcat Users List Subject: RE: Problems configuring Tomcat with Apache using mod_jk2 Rick, That's a leftover from the file on the web I copied my config from - it's commented out anyway. I haven't a clue what it does. All I know is that this set up works! Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems configuring Tomcat with Apache using mod_jk2
Looks like you need (assuming you don't already have) a [uri:/examples] worker=worker in your workers2.properties file to tell apache to forward such requests to tomcat.. hope this helps Kwong. -Original Message- From: David Godfrey [mailto:[EMAIL PROTECTED] Sent: Wednesday, 5 March 2003 3:36 To: '[EMAIL PROTECTED]' Subject: Problems configuring Tomcat with Apache using mod_jk2 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 Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]