Actually, you have more problems than that.  I looked at your httpd.conf and
workers.properties, and frankly it is hard for me to see how you got
anything working at all.

Your workers.properties only has an entry for localhost, not any of the
VirtualHosts you have setup in httpd.conf.

You server.xml has other hosts setup, but there is only an entry for one of
them in workers.properties.

Your httpd.conf is auto-generated (and hard to read).  My advice would be to
try it with just one host at a time, step-by-step, keeping it simple.  Get
it working for localhost, or one virtual host, then simply duplicate that
config for that working virtual host to the others, changing hostname and
paths as appropriate.

Basically, getting mod_jk to work is fairly easy...you just have to make the
right links between httpd.conf, workers.properties, and server.xml.

First, in server.xml, change the Host element so that the "name" parameter
equals the desired hostname, like this:

 <Host name="www.host.com" debug="0" appBase="webapps" unpackWARs="true">

Then, workers.properties:

== begin workers.properties ==

# Setup for apache system
#
workers.tomcat_home=/usr/local/jakarta-tomcat-4.0.4
workers.java_home=/usr/java/j2sdk1.4.0_01
ps=/
worker.list=ajp13

# Definition for Ajp13 worker
worker.ajp13.port=8009
worker.ajp13.host=www.host.com
worker.ajp13.type=ajp13

== end workers.properties ==

Then, the basic commands for httpd.conf:

== begin httpd.conf ==

<IfModule !mod_jk.c>
  LoadModule jk_module /usr/local/apache2/modules/mod_jk.so
</IfModule>

JkWorkersFile "/usr/local/jakarta-tomcat-4.0.4/conf/jk/workers.properties"
JkLogFile "/usr/local/jakarta-tomcat-4.0.4/logs/mod_jk.log"

JkLogLevel emerg

<VirtualHost www.host.com>

    ServerName www.host.com

    #################### www.host.com:/examples ####################

    # Static files
    Alias /examples "/usr/local/jakarta-tomcat-4.0.4/webapps/examples"

    <Directory "/usr/local/jakarta-tomcat-4.0.4/webapps/examples">
        Options Indexes FollowSymLinks
        DirectoryIndex index.html index.htm index.jsp
    </Directory>

    # Deny direct access to WEB-INF and META-INF
    <Location "/examples/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>

    <Location "/examples/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /examples/jsp/security/protected/j_security_check  ajp13
    JkMount /examples/CompressionTest  ajp13
    JkMount /examples/SendMailServlet  ajp13
    JkMount /examples/servletToJsp  ajp13
    JkMount /examples/snoop  ajp13
    JkMount /examples/*.jsp  ajp13
    JkMount /examples/servlet/*  ajp13

</VirtualHost>

== end httpd.conf ==

This is for the /examples URL of www.host.com, like this:
http://www.host.com/examples

I don't know how to make it any clearer than that.  This is a working
configuration.  Nothing else was changed, except to add the Listener
elements to server.xml so that the httpd.conf commands are auto-generated.
This is for Tomcat 4 and Apache 2.  Adding additional hosts is simply a
matter of duplicating the configuration for the first virtual host.  Adding
additional URI mappings for JkMount is left up to you.  I can't speak for
any sort of auto-generation helpers for Apache, which you seem to be
using...they may or may not munge up any manual configuration you do.

Hope this helps.

John

> -----Original Message-----
> From: Paul Gregoire [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 1:01 AM
> To: Tomcat Users List; [EMAIL PROTECTED]
> Subject: Re: Help : Apache 2.0.43 , Tomcat 4.1.12 , jk and/or 
> jk2 , win
> 2k 
> 
> 
> I have a similar problem, but the only thing i cant get 
> working is any url
> in which a servlet is being called..
> 
> x.x.44.54 - - [08/Oct/2002:21:29:21 -0800] "GET /servlet/test 
> HTTP/1.1"
> 404 -
> 
> The tomcat access log always reports a 404 no matter which 
> port the servlet
> is called on 80 or 8080.
> 
> I have tried both mod_jk as well as mod_jk2 and neither work. 
> I am running
> Apache 2.0.42 and Tomcat 4.1.12 on win2k/sp1 w/ jdk1.4.1 fcs.
> 
> Here is my setup:
> 
> APACHE2_HOME="C:\Program Files\Apache Group\Apache2"
> CATALINA_HOME=e:\tomcat
> JAVA_HOME=c:\jdk1.4
> Path="C:\Program Files\Apache Group\Apache2\bin";"C:\Program 
> Files\Apache
> Group\
> Apache2\modules";C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
> TOMCAT_HOME=e:\tomcat
> 
> C:\Program Files\Apache Group\Apache2\conf\httpd.conf
> C:\Program Files\Apache Group\Apache2\modules\mod_jk.dll
> C:\Program Files\Apache Group\Apache2\modules\mod_jk2.dll
> C:\Program Files\Apache Group\Apache2\modules\jkjni.dll
> C:\Program Files\Apache Group\Apache2\modules\jni_connect.dll
> E:\tomcat\conf\workers.properties
> E:\tomcat\conf\server.xml
> 
> conf files are attached.. maybe someone on this list can help 
> us both. :)
> 
> ----- Original Message -----
> From: "none none" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 08, 2002 12:27 PM
> Subject: Help : Apache 2.0.43 , Tomcat 4.1.12 , jk and/or jk2 , win 2k
> 
> 
> > Hi all,
> > I am trying to make working
> >  Apache 2.0.42 or 2.0.43 and
> >  Tomcat 4.1.10 or 4.1.12 with
> >  mod_jk or mod_jk2 on
> >  Windows 2K
> > since last friday with no results !!!
> > I don't know if is me, but i found really hard setup that enviroment
> lately, before was easy (until Apache 2.0.3x and Tomcat 4.0.4).
> >
> > Apache installation OK,
> > Tomcat installation OK,
> > Apache running on port 80 OK,
> > Tomcat running on port 8080 OK,
> >
> > I followed the HOW-TO guide step by step, but
> > Apache-Tomcat togheter are  NOT WORKING  , both cases 
> mod_jk and mod_jk2.
> > JK:
> > http://localhost:8080/examples  - running
> > http://localhost/examples - NOT RUNNING !!!
> > the error i get in the apache log is:
> > ...File not Found: C:/servers/apache2/htdocs/examples
> >
> > JK2:
> > same as above.
> > + really hard to setup all the parameters.
> >
> > why it is going in the htdocs folder?
> > I know i could set 'htdocs' to point to 'tomcat/webapps' , 
> but even if i
> do it will not work, this time i have a 404 error from Tomcat.
> > Also the auto-conf file contain the alias + directory 
> definition inside,
> so should be not necessary, right?
> >
> > Please help, it's driving me crazy.
> > thank you.
> >
> >
> >
> > ____________________________________________________________
> > Watch a championship game with Elway or McGwire.
> > Enter Now at http://champions.lycos.com
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to