Specifically this line:
# define the worker [ajp13:/opt/jakarta/jakarta-tomcat/work/jk2.socket] channel=channel.un:/opt/jakarta/jakarta-tomcat/work/jk2.socket
You want to change that to this:
# define the worker [ajp13:localhost:8009] channel=channel.socket:localhost:8009
Ed
Mike Burkhouse wrote:
Now we're getting somewhere...Instead of displaying the jsp code, I get an internal server error.
From httpd_error_log:
[Mon Apr 05 12:21:25 2004] [notice] SIGHUP received. Attempting to restart [Mon Apr 05 12:21:25 2004] [error] jk2_init() Can't find child 3272 in scoreboard [Mon Apr 05 12:21:25 2004] [error] uriEnv.init() map to invalid worker /*.jsp ajp13:localhost:8009 [Mon Apr 05 12:21:25 2004] [notice] workerEnv.init() ok /usr/local/apache2/conf/workers2.properties [Mon Apr 05 12:21:25 2004] [error] mod_jk child init 1 -2 [Mon Apr 05 12:21:25 2004] [error] jk2_init() Can't find child 3273 in scoreboard [Mon Apr 05 12:21:25 2004] [error] uriEnv.init() map to invalid worker /*.jsp ajp13:localhost:8009 [Mon Apr 05 12:21:25 2004] [notice] workerEnv.init() ok /usr/local/apache2/conf/workers2.properties [Mon Apr 05 12:21:25 2004] [error] mod_jk child init 1 -2 [Mon Apr 05 12:21:25 2004] [error] jk2_init() Can't find child 3274 in scoreboard [Mon Apr 05 12:21:25 2004] [error] uriEnv.init() map to invalid worker /*.jsp ajp13:localhost:8009 [Mon Apr 05 12:21:25 2004] [notice] workerEnv.init() ok /usr/local/apache2/conf/workers2.properties [Mon Apr 05 12:21:25 2004] [error] mod_jk child init 1 -2 [Mon Apr 05 12:21:25 2004] [error] jk2_init() Can't find child 3275 in scoreboard [Mon Apr 05 12:21:25 2004] [error] uriEnv.init() map to invalid worker /*.jsp ajp13:localhost:8009 [Mon Apr 05 12:21:25 2004] [notice] workerEnv.init() ok /usr/local/apache2/conf/workers2.properties [Mon Apr 05 12:21:25 2004] [error] mod_jk child init 1 -2 [Mon Apr 05 12:21:25 2004] [error] jk2_init() Can't find child 3276 in scoreboard [Mon Apr 05 12:21:25 2004] [error] uriEnv.init() map to invalid worker /*.jsp ajp13:localhost:8009 [Mon Apr 05 12:21:25 2004] [notice] workerEnv.init() ok /usr/local/apache2/conf/workers2.properties [Mon Apr 05 12:21:25 2004] [error] mod_jk child init 1 -2 [Mon Apr 05 12:21:25 2004] [notice] Apache/2.0.48 (Unix) mod_jk2/2.0.2 configured -- resuming normal operations [Mon Apr 05 12:21:50 2004] [error] jk2_init() Can't find child 3277 in scoreboard [Mon Apr 05 12:21:50 2004] [error] uriEnv.init() map to invalid worker /*.jsp ajp13:localhost:8009 [Mon Apr 05 12:21:50 2004] [notice] workerEnv.init() ok /usr/local/apache2/conf/workers2.properties [Mon Apr 05 12:21:50 2004] [error] mod_jk child init 1 -2 [Mon Apr 05 12:21:59 2004] [notice] mod_jk.handler() finding worker for 0 811e2d0 ajp13:localhost:8009 [Mon Apr 05 12:21:59 2004] [error] mod_jk.handle() No worker for /employment-resume.jsp [Mon Apr 05 12:22:18 2004] [notice] mod_jk.handler() finding worker for 0 811e2d0 ajp13:localhost:8009 [Mon Apr 05 12:22:18 2004] [error] mod_jk.handle() No worker for /contact.jsp
Is this a problem with my server.xml file, or my workers2.properties file?
Mike
-----Original Message-----
From: Ed Robbins [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 10:08 AM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat Configuration with Apache Virtual Hosts
It also appears that you can put this directive in your virtual host section for that domain:
<Location "/*.jsp"> JkUriSet worker ajp13:localhost:8009 </Location>
Ed
Mike Burkhouse wrote:
Hi Ed,
Sorry for not being more clear.
That is correct that I am trying to run jsp's under the Consultants Network domain. When I try to run a jsp, the jsp code is displayed.
Are you suggesting something like this:
<VirtualHost *:80> ServerAdmin [EMAIL PROTECTED] DocumentRoot /usr/local/apache2/htdocs ServerName www.consultantsnetwork.com JkMount /*.jsp ajp13 ErrorLog logs/cn/cn-error_log CustomLog logs/cn/cn-access_log common </VirtualHost>
If so, I get this:
[EMAIL PROTECTED] conf]# /etc/rc.d/init.d/apachectl restart Syntax error on line 1053 of /usr/local/apache2/conf/httpd.conf:
Invalid command 'JkMount', perhaps mis-spelled or defined
by a module
not included in the server configuration
Mike
-----Original Message----- From: Ed Robbins [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 9:25 AM To: [EMAIL PROTECTED] Subject: Re: Tomcat Configuration with Apache Virtual Hosts
Mike,
Can you give me a little more background on the problem. It
looks like you are trying to run jsp's under the consultantsnetwork domain, is this correct? What happens when you try to?
My first stab at it is that you don't tell apache to use
tomcat when a jsp is requested. You should add a directive in the
VirtualHost for
consultantsnetwork that looks like this:
JkMount /*.jsp ajp13
Ed
Mike Burkhouse wrote:
Hi All,
I am still dorking around with this after writing the list
a couple of
weeks ago. I am trying to run JSPs using tomcat through Apache
virtual hosts. To refresh, I have 2 domains, I want one to
run JSPs,
the other one will not. All I can think to do at this point is send
you my configuration files with hopes that one of you will
recognize
an error that I made and make suggestions for correcting
it. Please
let me know if I left out any relevant information. Sorry
if this is
all a mess, it is my first time configuring Tomcat.
Thank You in advance for your time.
Mike
1. Environment: RHEL 3 Apache 2.0.48 Tomcat 4.1
2. Documents read/followed:
http://cymulacrum.net/writings/tomcat5/book1.html
http://www.galatea.com/flashguides/virtual-hosting-tomcat.xml
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhos
thowto.htm
l
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/aphowto.html
3. Configuration Files:
Apache Configuration Files:
A. /usr/local/apache2/conf/httpd.conf, relevant sections
# # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was
built as a
DSO you # have to place corresponding `LoadModule' lines at this
location so the # directives contained in it are actually
available
_before_ they are used. # Statically compiled modules
(those listed by
============================================================`httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so #
LoadModule jk2_module modules/mod_jk2.so
[..]
#Virtual Hosts NameVirtualHost *:80
<VirtualHost *:80> ServerAdmin [EMAIL PROTECTED] DocumentRoot /usr/local/apache2/htdocs ServerName www.consultantsnetwork.com ErrorLog logs/cn/cn-error_log CustomLog logs/cn/cn-access_log common </VirtualHost>
<VirtualHost *:80> ServerAdmin [EMAIL PROTECTED] DocumentRoot /usr/local/apache2/htdocs/LV ServerName www.learningvoyage.com ErrorLog logs/lv/lv-error_log CustomLog logs/lv/lv-access_log common </VirtualHost>
==========
====== ================== B. /usr/local/apache2/conf/workers2.properties:
[EMAIL PROTECTED] conf]# more workers2.properties # Workers2.properties
[logger.apache2] level=debug
[shm] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/opt/jakarta/jakarta-tomcat/logs/jk2.shm size=1048576 debug=0 disabled=0
#Unix domain socket [channel.un:/opt/jakarta/jakarta-tomcat/work/jk2.socket] tomcatId=localhost:8009 debug=0
# define the worker [ajp13:/opt/jakarta/jakarta-tomcat/work/jk2.socket] channel=channel.un:/opt/jakarta/jakarta-tomcat/work/jk2.socket
#Announce a "status" worker [status:status] info=Status worker. Displays runtime information.
[uri:/jkstatus/*] group=status:status
# Uri Mapping # Double check this URI mapping ~RU [uri:www.consultantsnetwork.com/*.jsp]
============================================================
==========
====== =======================
============================================================== ==============
=======================
Tomcat Configuration Files:
/opt/jakarta/jakarta-tomcat/conf/server.xml: Mostly
default. I will
post ony changed sections here.
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on
port 8008 -->
<Connector
className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8008" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0"
connectionTimeout="20000"
useURIValidationHack="false"
disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set
connectionTimeout value
to 0 -->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector
className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75" enableLookups="true" acceptCount="100" debug="0" scheme="https" secure="true" useURIValidationHack="false"
disableUploadTimeout="true">
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory" clientAuth="false" protocol="TLS" /> </Connector> -->
<!-- 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="0" useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<!-- Define an AJP 1.3 Connector on port 8009 --> <!-- <Connector className="org.apache.ajp.tomcat4.Ajp13Connector" port="8009" minProcessors="5" maxProcessors="75" acceptCount="10" debug="0"/> -->
[..]
<!-- Tomcat CN Context --> <Engine name="Apache"
defaultHost="www.consultantsnetwork.com"
debug="0">
<Host name="www.consultantsnetwork.com" debug="0"
appBase="$TOMCAT_HOME/webapps/ROOT/"
unpackWARs="true" autoDeploy="true">
<Context Path="$TOMCAT_HOME/webapps/ROOT/"
docBase="ROOT" debug="0"
reloadable="true" crossContext="true">
<Logger
className="org.apache.catallina.logger.FileLogger"
============================================================prefix="localhost_cn_log." suffix=".txt" timestamp="true"/> <Resource name="mail/Session" auth="Container" type="javax.mail.Session"/> <ResourceParams name="mail/Session"> <parameter> <name>mail.smtp.host</name> <value>216.196.239.90</value> </parameter> </ResourceParams> </Context> </Host> </Engine> </Engine>
</Service>
</Server>
==========
====== ======================== 4. Log Files:
A. /opt/jakarta/jakarta-tomcat/conf/logs/catalina.out (tail -n 40)
Starting service Tomcat-Standalone
Apache Tomcat/4.1.30
Mar 25, 2004 11:50:09 AM
org.apache.struts.util.PropertyMessageResources
<init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
Mar 25, 2004 11:50:09 AM
org.apache.struts.util.PropertyMessageResources
<init> INFO: Initializing,
config='org.apache.struts.action.ActionResources',
returnNull=true Mar 25, 2004 11:50:10 AM
org.apache.struts.util.PropertyMessageResources
<init> INFO: Initializing,
config='org.apache.webapp.admin.ApplicationResources',
returnNull=true Mar 25, 2004 11:50:11 AM
org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8008
Mar 25, 2004 11:50:11 AM org.apache.jk.server.JkMain start
INFO: APR not loaded, disabling jni components:
java.io.IOException:
java.lang.UnsatisfiedLinkError:
/usr/local/apache2/modules/jkjni.so:
/usr/local/apache2/lib/libaprutil-0.so.0: undefined symbol:
gdbm_errno
Mar 25, 2004 11:50:11 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Mar 25, 2004 11:50:11 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/63 config=/opt/jakarta/jakarta-tomcat/conf/jk2.properties
Stopping service Tomcat-Standalone
Mar 25, 2004 12:23:22 PM
org.apache.coyote.http11.Http11Protocol destroy
INFO: Stoping http11 protocol on 8008
Catalina:type=ThreadPool,name=http8008
Mar 25, 2004 1:04:30 PM
org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8008 Starting service Tomcat-Standalone Apache Tomcat/4.1.30 Mar 25, 2004 1:04:32 PM
org.apache.struts.util.PropertyMessageResources
<init> INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Mar 25, 2004 1:04:32 PM
org.apache.struts.util.PropertyMessageResources
<init> INFO: Initializing,
config='org.apache.struts.action.ActionResources',
returnNull=true Mar 25, 2004 1:04:32 PM
org.apache.struts.util.PropertyMessageResources
<init> INFO: Initializing,
config='org.apache.webapp.admin.ApplicationResources',
returnNull=true Mar 25, 2004 1:04:35 PM
org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8008
Mar 25, 2004 1:04:35 PM org.apache.jk.server.JkMain start
INFO: APR not loaded, disabling jni components:
java.io.IOException:
java.lang.UnsatisfiedLinkError:
/opt/jakarta/jakarta-tomcat-connectors/jk/build/jk2/apache2/
jkjni.so:
/usr/local/apache2/lib/libaprutil-0.so.0: undefined symbol:
gdbm_errno
Mar 25, 2004 1:04:35 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Mar 25, 2004 1:04:35 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=13/167 config=/opt/jakarta/jakarta-tomcat/conf/jk2.properties
Stopping service Tomcat-Standalone
Mar 25, 2004 2:52:00 PM
org.apache.coyote.http11.Http11Protocol destroy
INFO: Stoping http11 protocol on 8008
Catalina:type=ThreadPool,name=http8008
============================================================
==========
====== ===============
------------------------------------------------------------
---------
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]
