You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brad O'Hearne <br...@neurofire.com> on 2006/02/17 04:00:22 UTC

configuring mod_jk with apache / tomcat

I am trying to get the Tomcat connector configured to connect tomcat and 
apache and I have two questions:

1) I downloaded the binary distribution for linux, and the filename was: 
jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64-worker.so. Is 
this supposed to be mod_jk?

2) What kind of workers.properties should I have? There is no sample in 
the http/conf or tomcat/conf directory.

Thanks,

Brad

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


Re: configuring mod_jk with apache / tomcat

Posted by David Avenante <d....@gmail.com>.
 1 - Yes it's seems the good binary.
 2 - sample part httpd.conf to add for support mod_jk in apache

# Load mod_jk module
LoadModule    jk_module    modules/mod_jk.so
JkWorkersFile /etc/apache2/jk-workers.properties
JkLogFile     /var/log/apache2/mod_jk.log
JkLogLevel    ERROR
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat     "%w %V %T"
JkMount /cluster-1.0-SNAPSHOT/app*  loadbalancer

Be carreful :
in the line LoadModule,   modules/mod_jk.so is the path to your module
in the line JkWorkersFile, /etc/apache2/jk-workers.properties is the path to
you workers.properties

for a sample of worker propertie

# workers.properties
ps=/

# List the workers name
worker.list=node01
# ----------------
# First worker
# ----------------
worker.node01.port=8009
worker.node01.host=agnes
worker.node01.type=ajp13

Be carefull when you configure your Tomcat's server.xml file
add jvmRoute="node01" in your engine.

Be think to read the documentation of tomcat 5.5
and the documentation of apache connector for better configuration

On 2/17/06, Brad O'Hearne <br...@neurofire.com> wrote:
>
> Bump. Does anyone have any idea on these? I need to get Tomcat
> configured with apache. Thanks!
>
> Brad
>
> On Feb 16, 2006, at 8:00 PM, Brad O'Hearne wrote:
>
> > I am trying to get the Tomcat connector configured to connect
> > tomcat and apache and I have two questions:
> >
> > 1) I downloaded the binary distribution for linux, and the filename
> > was: jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64-
> > worker.so. Is this supposed to be mod_jk?
> >
> > 2) What kind of workers.properties should I have? There is no
> > sample in the http/conf or tomcat/conf directory.
> >
> > Thanks,
> >
> > Brad
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: configuring mod_jk with apache / tomcat

Posted by Richard Mixon <rn...@qwest.net>.
Brad,

I also am running SuSE SLES9 and have mod_jk connecting apache to tomcat.

Here are the packages I have installed:
  # rpm -qa | egrep apache2
  apache2-example-pages-2.0.49-27.29
  apache2-mod_php4-4.3.4-43.46.8
  apache2-prefork-2.0.49-27.38
  apache2-devel-2.0.49-27.34
  apache2-worker-2.0.49-27.38
  apache2-jakarta-tomcat-connectors-5.0.19-29.1
  apache2-doc-2.0.49-27.29
  apache2-2.0.49-27.38
  # rpm -qa | egrep jakarta
  jakarta-tomcat-doc-5.0.19-29.1
  jakarta-tomcat-examples-5.0.19-29.1
  jakarta-tomcat-5.0.19-29.1
  apache2-jakarta-tomcat-connectors-5.0.19-29.1

SLES9's YAST configuration tool will do much of the work for you. But it
will not do the actual mapping of a specific set of URL's to a given web
application. You will need to edit one or more of the files in
/etc/apache2/vhosts/ in order to set this.

First, be sure that the line in /etc/sysconfig/apache2 that begins with
APACHE_MODULES has jk listed as one of the modules (no mod_ prefix is
needed). Afterwards be sure and run the SuSEconfig command.

Next, if you are using virtual hosts, then the virtual host definition files
in /etc/apache2/vhosts will need to be edited with the statements similar to
those shown below. If you are not using virtual hosts, then you can put
these statements in /etc/apache2/default-server.conf:

Here are the key Apache config files that need settings. I had to change
them to work for a single Tomcat server and I believe I got it right (my
config load balances between to Tomcat servers)

  /etc/apache2/conf.d/jk.conf
  /etc/apache2/conf.d/workers.proeprties
  /etc/apache2/vhosts/<vhost-definition-file>
  OR
  etc/apache2/default-server.conf

Below are the contents:
FILE: /etc/apache2/conf.d/jk.conf
  # simple configuration for apache (for AJP connector, modul mod_jk.so)

  <IfModule mod_jk.c>

      JkWorkersFile /etc/apache2/conf.d/workers.properties
      JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
      JkLogFile /var/log/apache2/mod_jk.log

      # Log level to be used by mod_jk: debug, info, warn error or trace
      JkLogLevel info

      JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
      JkExtractSSL on
      JkHTTPSIndicator HTTPS
      JkSESSIONIndicator SSL_SESSION_ID
      JkCIPHERIndicator SSL_CIPHER
      JkCERTSIndicator SSL_CLIENT_CERT

  </IfModule>

FILE: /etc/apache2/conf.d/workers.properties
  # workers.properties -
  #
  #workers.tomcat_home=/home/ltojsw/tomcat
  #workers.java_home=/usr/lib/java
  ps=/

  worker.status.type=status

  #
  # Define one worker for each tomcat instance, plus one
  # to handle the load balancing.
  #
  worker.list=srv1, status

  worker.srv1.port=8009
  worker.srv1.host=greenfishS11
  worker.srv1.type=ajp13
  worker.srv1.lbfactor=100
  #worker.srv1.sticky_session=False
  worker.srv1.local_worker=0
  worker.srv1.tomcatId=srv1


FILE: /etc/apache2/vhosts/vhost1
OR
FILE: /etc/apache2/listen.conf
  ...
  <IfModule mod_jk.c>

    # The following line makes apache aware of the location of
    # the /tictactoe context
    Alias /tictactoe "/home/ltojsw/tomcat/webapps/tictactoe"
    <Directory "/home/ltojsw/tomcat/webapps/tictactoe">
     Options Indexes FollowSymLinks
     allow from all
    </Directory>

    # The following line "mounts" all "tictactoe" URLs files to tomcat
    JkMount /tictactoe/* srv1

    # The following line prohibits users from directly accessing WEB-INF
    <Location "/tictactoe/WEB-INF/">
     AllowOverride None
     deny from all
    </Location>

    <Location /jkstatus >
      JkMount status
      Order deny,allow
      Deny from all
      # Allow from 127.0.0.1
      Allow from 130.13.3.7
        AuthType Basic
        AuthName "Restricted Files"
        AuthUserFile /home/ltojcg/htdocs_passwd/.passwords
        Require user jkstatus
    </Location>

    JkShmFile /var/log/apache2/jk.shm

    JkMount /jkstatus/* status
  </IfModule>
  ...

Hope this helps.

 - Richard

-----Original Message-----
From: Brad O'Hearne [mailto:brado@neurofire.com] 
Sent: Friday, February 17, 2006 7:34 AM
To: Tomcat Users List
Subject: Re: configuring mod_jk with apache / tomcat

Bump. Does anyone have any idea on these? I need to get Tomcat configured
with apache. Thanks!

Brad

On Feb 16, 2006, at 8:00 PM, Brad O'Hearne wrote:

> I am trying to get the Tomcat connector configured to connect tomcat 
> and apache and I have two questions:
>
> 1) I downloaded the binary distribution for linux, and the filename
> was: jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64-
> worker.so. Is this supposed to be mod_jk?
>
> 2) What kind of workers.properties should I have? There is no sample 
> in the http/conf or tomcat/conf directory.
>
> Thanks,
>
> Brad
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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



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


Re: configuring mod_jk with apache / tomcat

Posted by Brad O'Hearne <br...@neurofire.com>.
Bump. Does anyone have any idea on these? I need to get Tomcat  
configured with apache. Thanks!

Brad

On Feb 16, 2006, at 8:00 PM, Brad O'Hearne wrote:

> I am trying to get the Tomcat connector configured to connect  
> tomcat and apache and I have two questions:
>
> 1) I downloaded the binary distribution for linux, and the filename  
> was: jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64- 
> worker.so. Is this supposed to be mod_jk?
>
> 2) What kind of workers.properties should I have? There is no  
> sample in the http/conf or tomcat/conf directory.
>
> Thanks,
>
> Brad
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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