You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jason Nichols <ja...@quantumland.com> on 2005/02/09 20:17:30 UTC

help: connecting Tomcat 5.5 to Apache 2.0 with mod_jk 1.2.8 on ISP's server

Hello all:
  I've been working on installing Tomcat 5.5 with Apache 2.0 for about two
weeks now, and I've been stuck with an error for a week. A lot of my
difficulty is that I'm working on a leased ISP's server, and am dealing with
a complex pre-existing Apache installation.

If you can help or tell me about a good source for integrating Apache with
Tomcat via mod_jk (other than apache.org & google, which I've been using),
that would be great. 
I'm trying to get to the standard Tomcat examples pages. Any help is
appreciated.

Problem:
 Apache 2.0.50 running on a (virtual) server, musegraphics.musegraphics.com,
leased from an ISP (olm.net). Apache works fine. Installed Tomcat 5.5.4,
connecting it to Apache via mod_jk version 1.2.8.

When I have this line 
JkMount /* musegraphicsworker
in httpd.conf (actually a file included by httpd.conf) I get the Apache
"Internal Server Error" page. I also get the following in mod_jk.log
map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/' from
1 maps
map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI
'/*'
map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match
musegraphicsworker -> /
jk_handler::mod_jk.c (1715): Into handler jakarta-servlet
worker=musegraphicsworker r->proxyreq=0
wc_get_worker_for_name::jk_worker.c (92): did not find a worker
musegraphicsworker
jk_handler::mod_jk.c (1883): Could not find a worker for worker
name=musegraphicsworker

When I comment it out, Apache works fine, but of course no Tomcat access.
Any ideas would be appreciated
Jason





More info on Stuff I've done:
I added these to httpd.conf:
LoadModule jk_module modules/mod_jk.so #at the end of the LoadModule's list

And I commented out these(put there by my ISP), b/c they seemed to be
interfering with mod_jk.so

#<IfModule mod_jk.c>
#  JkWorkersFile /etc/httpd/conf/workers.properties   
 # <IfDefine PROD_SERVER>
#       JkLogFile    /var/log/httpd/mod_jk.log
 # </IfDefine>
  #<IfDefine TEST_SERVER>
#       JkLogFile    /var/log/httpd-test/mod_jk.log
 # </IfDefine>
#  JkLogLevel  error
#</IfModule>

Here are the lines I added to workers.properties

worker.musegraphicsworker.type=ajp13
worker.musegraphicsworker.host=www.musegraphics.com
worker.musegraphicsworker.port=8011
worker.musegraphicsworker.cachesize=10
worker.musegraphicsworker.cache_timeout=600
worker.musegraphicsworker.socket_timeout=300
worker.musegraphicsworker.socket_keepalive=1

What I've done to solve it:
I've googled a lot, & I've also searched this list's archive, found one
person with the same problem but no answer. Again, any help would be greatly
appreciated.  I'm fairly new 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: help: connecting Tomcat 5.5 to Apache 2.0 with mod_jk 1.2.8 on ISP's server: SOLVED.

Posted by Jason Nichols <ja...@quantumland.com>.
Chris:
  It's working! Thanks a LOT! What you gave me wasn't the full answer, but
it let me eliminate a lot of dead-ends and other mistakes I had made.

One (of several) problems this helped was that I was using "AddModule" and
not "LoadModule", which is also addressed here:
http://www.apache.org/~rbowen/presentations/apachecon2004/apache2.0/slide35.
html

I also put my workers.properties file in the same directory as httpd.conf
b/c of something I read somewhere. Not sure if that actually did anything.

I found my problem on other sites with no answers, so I'm going to include
the relevant parts of my httpd.conf and workers.properties, in case others
have a similar situation.

Thanks again,
Jason
Musegraphics.com




My setup: leasing a virtual server from olm.net
Apache 2.0.50, Tomcat 5.5.4, mod_jk 1.2.8

Relevant parts of my httpd.conf:

LoadModule	jk_module	modules/mod_jk.so
#AddModule modk_jk.c
JkWorkersFile 	/etc/httpd/conf/workers.properties
JkLogFile 	/etc/httpd/logs/mod_jk.log
JkLogLevel	debug
JkLogStampFormat "[%a %b %d %H:%M] "
JkOptions	+ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat	"%w %V %T"
JkMount	/examples/* musegraphicsworker
JkMount /*.jsp musegraphicsworker

<VirtualHost 69.94.10.74:80>
	ServerName www.musegraphics.com
	ServerAdmin usnjay@yahoo.com
	#DocumentRoot /home/virtual/site1/fst/var/www/html  <--this was
another problem I had. Gotta change this after adding Tomcat to Apache.
Seems obvious now. Changed to the following:
 
	DocumentRoot /usr/local/tomcat/tomcatCV/webapps/jsp-examples

	<Directory /usr/local/tomcat/tomcatCV/webapps/jsp-examples>
		Allow from all
		AllowOverride All
		Order allow,deny
	</Directory>

# A lot other stuff here my ISP (olm.net) put in, not included for brevity.
</VirtualHost>



My workers.properties file:
#
workers.tomcat_home=/usr/local/tomcat/ 
# workers.java_home should point to your Java installation. 
workers.java_home=/usr/local/java

# You should configure your environment slash... ps=\ on NT and / on UNIX
ps=/

#------ workers list ------------------------------------------------
worker.list=musegraphicsworker

#------ musegraphicsworker DEFINITION---------------------------------
worker.musegraphicsworker.type=ajp13
worker.musegraphicsworker.host=localhost
worker.musegraphicsworker.port=8009
worker.musegraphicsworker.lbfactor=50
worker.musegraphicsworker.cachesize=10
worker.musegraphicsworker.cache_timeout=600
worker.musegraphicsworker.socket_timeout=300
worker.musegraphicsworker.socket_keepalive=1


There's quite a bit more but those are the parts I changed out of the
already existing (and highly complex) Apache configuration my ISP had in
place. 
Jason


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: help: connecting Tomcat 5.5 to Apache 2.0 with mod_jk 1.2.8 on ISP's server

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
Try something like this in your httpd.conf:

<IfDefine HAVE_JK>
LoadModule jk_module modules/mod_jk.so

<IfModule mod_jk.c>

JkWorkerProperty        worker.musegraphicsworker.type=ajp13
JkWorkerProperty        worker.musegraphicsworker.host=127.0.0.1
JkWorkerProperty        worker.musegraphicsworker.port=8011

JkWorkerProperty        worker.list=musegraphicsworker

JkMount                 /*.jsp musegraphicsworker

JkLogFile               logs/mod_jk.log
JkLogLevel              debug
JkOptions               +ForwardKeySize +ForwardURICompat 
-ForwardDirectories

</IfModule>
# mod_jk.c

</IfDefine>
# HAVE_JK

     Make sure to bind the ajp connector to 127.0.0.1 in your 
server.xml.  You don't want to serve requests from anywhere else for 
obvious reasons.  Here's an example:

     <Connector port="8011"
                address="127.0.0.1"
                enableLookups="false"
                redirectPort="8443"
                protocol="AJP/1.3" />

Jason Nichols wrote:
> Hello all:
>   I've been working on installing Tomcat 5.5 with Apache 2.0 for about two
> weeks now, and I've been stuck with an error for a week. A lot of my
> difficulty is that I'm working on a leased ISP's server, and am dealing with
> a complex pre-existing Apache installation.
> 
> If you can help or tell me about a good source for integrating Apache with
> Tomcat via mod_jk (other than apache.org & google, which I've been using),
> that would be great. 
> I'm trying to get to the standard Tomcat examples pages. Any help is
> appreciated.
> 
> Problem:
>  Apache 2.0.50 running on a (virtual) server, musegraphics.musegraphics.com,
> leased from an ISP (olm.net). Apache works fine. Installed Tomcat 5.5.4,
> connecting it to Apache via mod_jk version 1.2.8.
> 
> When I have this line 
> JkMount /* musegraphicsworker
> in httpd.conf (actually a file included by httpd.conf) I get the Apache
> "Internal Server Error" page. I also get the following in mod_jk.log
> map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/' from
> 1 maps
> map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI
> '/*'
> map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match
> musegraphicsworker -> /
> jk_handler::mod_jk.c (1715): Into handler jakarta-servlet
> worker=musegraphicsworker r->proxyreq=0
> wc_get_worker_for_name::jk_worker.c (92): did not find a worker
> musegraphicsworker
> jk_handler::mod_jk.c (1883): Could not find a worker for worker
> name=musegraphicsworker
> 
> When I comment it out, Apache works fine, but of course no Tomcat access.
> Any ideas would be appreciated
> Jason
> 
> 
> 
> 
> 
> More info on Stuff I've done:
> I added these to httpd.conf:
> LoadModule jk_module modules/mod_jk.so #at the end of the LoadModule's list
> 
> And I commented out these(put there by my ISP), b/c they seemed to be
> interfering with mod_jk.so
> 
> #<IfModule mod_jk.c>
> #  JkWorkersFile /etc/httpd/conf/workers.properties   
>  # <IfDefine PROD_SERVER>
> #       JkLogFile    /var/log/httpd/mod_jk.log
>  # </IfDefine>
>   #<IfDefine TEST_SERVER>
> #       JkLogFile    /var/log/httpd-test/mod_jk.log
>  # </IfDefine>
> #  JkLogLevel  error
> #</IfModule>
> 
> Here are the lines I added to workers.properties
> 
> worker.musegraphicsworker.type=ajp13
> worker.musegraphicsworker.host=www.musegraphics.com
> worker.musegraphicsworker.port=8011
> worker.musegraphicsworker.cachesize=10
> worker.musegraphicsworker.cache_timeout=600
> worker.musegraphicsworker.socket_timeout=300
> worker.musegraphicsworker.socket_keepalive=1
> 
> What I've done to solve it:
> I've googled a lot, & I've also searched this list's archive, found one
> person with the same problem but no answer. Again, any help would be greatly
> appreciated.  I'm fairly new 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org