Johnny:

You should be trying to get "Apache to talk to Tomcat".  You have to
do the configurations and workers.properties file yourself.

You should first be sure that the AJP 1.3 module is loaded when Apache
starts.  This occurs when you include the module in your httpd.conf.
The line should contain a path to the module.  Hopefully you will
already have the module.  If not, you'll need to compile the module.

Once you're sure that the module exists somewhere.  Include the module
like so in httpd.conf.:

LoadModule jk_module /usr/local/apache2/modules/mod_jk.so

NOTE:  remember the path is to your module.  This example is to "my" module.

Now, you'll need a section in the httpd.conf that identifies the
workers.properties file and configures the virtual URL that will send
requests through your AJP connector in Tomcat.

Here's a snippet for example:

#JK configuration
JkWorkersFile /usr/local/apache2/conf/workers.properties
JkLogFile /usr/local/apache2/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkRequestLogFormat "%w %V %T"
JkMount /mytomcatapp/* worker

Create a file in the /conf directory called workers.properties and add
the following:

worker.list=worker
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009

Let's recap what this does.  Apache receives a request to URL
http://yourserver.com/mytomcatapp and because of you've configured the
AJP module for this virtual URL, the request is sent (in binary Apache
Java Protocol (AJP/1.3) to the 8009 connector that Tomcat is hosting.
Commonly the 8009 connector just redirects to either the 8080 or 8443
connector.  The request that was originally intercepted by Apache is
served by Tomcat.

HTH,

David

On 8/22/08, Johnny Kewl <[EMAIL PROTECTED]> wrote:
>
> ----- Original Message ----- From: "cornercuttin" <[EMAIL PROTECTED]>
> To: <users@tomcat.apache.org>
> Sent: Friday, August 22, 2008 2:34 PM
> Subject: tomcat 6 won't generate mod_jk.conf
>
>
> >
> > perhaps someone can help me here.
> >
> > i am trying to get tomcat 6 to talk to apache 2.2.8 (fedora core 5), and i
> > can't get very far.
> >
> > firstly, tomcat 6 doesn't come with a workers.properties file.
> >
> > secondly, when i start tomcat via the command "./startup.sh -jkconf" or
> > "./startup.sh jkconf", i cannot get tomcat to create a mod_jk.conf in the
> > conf directory.  tomcat runs, but no file is created.
> >
> > is there something that i am missing here?  i've never needed tomcat until
> > now, so i am new at this (tomcat), but proficient enough in apache.  but
> all
> > of the documentation i am finding online is saying that the mod_jk.conf
> file
> > is necessary and that tomcat will create it, but i cannot seem to get it
> to
> > work.
> >
> > thanks for any help.
> >
>
> I actually never knew it was possible from the scripts...
> We always put it in the server.xml file..
> but the bad news is that (I think) the autogen stuff is no longer available
> in 6, and if it did work would probably be wrong...
>
> Read up on the load sharing stuff... Thats the way to go...
> ie a single tomcat is just a special load sharing case...
>
> make a mod_jk.conf file
> include that in the apache httpd config... near the bottom somewhere
>
> stick something like this in it... modify as needed
> <IfModule !mod_jk.c>
>  LoadModule jk_module "D:/DEV/Apache2.2/modules/mod_jk.so"
> </IfModule>
>
> JkWorkersFile conf/jk/workers.properties
> JkLogFile conf/jk/mod_jk.log
>
> JkLogLevel info
>
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
> JkRequestLogFormat "%w %V %T"
>
> # Add shared memory.
> # This directive is present with 1.2.10 and
> # later versions of mod_jk, and is needed for
> # for load balancing to work properly
> # JkShmFile conf/jk/jk.shm
>
> # Mount apps
>
>   JkMount /estate/blog  lb
>   JkMount /estate/eyesonly.jpg  lb
>   JkMount /estate/start  lb
>   JkMount /estate/*.jspx  lb
>   JkMount /estate/listingEntry  lb
>   JkMount /estate/*.jsp  lb
>   JkMount /estate/smartText  lb
>
>
> # Add the jkstatus mount point
>  JkMount /jkstatus jkstatus
>
> then make a workers.properties file
> stick something like this in it
>
> # BEGIN workers.properties
> # Set properties for loadbalancer scheme
> worker.list=lb,jkstatus
> # Set WORKER1
> worker.worker1.port=8009
> worker.worker1.host=animal
> worker.worker1.type=ajp13
> worker.worker1.lbfactor=50
> worker.worker1.recover_time=60
> #worker.worker1.local_worker=1
> #worker.worker1.cachesize=10
> #worker.worker1.socket_keepalive=1
> # Set WORKER2
> worker.worker2.port=8009
> worker.worker2.host=hplt1
> worker.worker2.type=ajp13
> worker.worker2.lbfactor=50
> worker.worker2.recovery_options=60
> #worker.worker2.local_worker=1
> #worker.worker2.cachesize=10
> #worker.worker2.socket_keepalive=1
> # Set LOADBALANCER
> worker.lb.type=lb
> # HERE is where you decide on how many TC's there are
> worker.lb.balance_workers=worker1,worker2
> worker.lb.sticky_session=1
> worker.lb.sticky_session=true
> worker.lb.sticky_session_force=false
> #worker.lb.method=B
> #worker.lb.local_worker=1
> # Set STATUS MONITORING
> worker.jkstatus.type=status
> # END workers.properties
>
>
> Then make sure each tomcats ports match what you set up here... its the AJP
> stuff
> in server.xml
>
> Without doing much else... you will be able to access tomcat directly thru
> port 8080
> but the apache 80 port will come thru this stuff...
>
> The above is a test I was helping someone with... losts of commented out and
> in stuff...
> so you can play...
>
> Forget about the auto stuff... you dont really need it, but it was kind of
> nice for newbies... once ;)
>
> Have Fun...
> ---------------------------------------------------------------------------
> HARBOR : http://www.kewlstuff.co.za/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> See it in Action :
> http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
> ---------------------------------------------------------------------------
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to