vendredi 1 juillet 2011

TOMCAT - mod_jk & Serveur HTTP

Fichier de configuration qui mappe le serveur http vers les jvm

Ce fichier doit être contenu dans le HTTPD/conf et déclaré dans le fichier httpd.conf

Extrait httpd.conf

Ne pas oublier de compiler déposer ou compiler le module dynamique Tomcat sous ~/modules
../..
# LoadModule foo_module modules/mod_foo.so
LoadModule php5_module        modules/libphp5.so
LoadModule jk_module          modules/mod_jk-1.2.27-httpd-2.2.6.so

#
# Mod_jk settings
#
JkWorkersFile "/usr/product/apache/httpd-2.2.11/conf/workers.properties"
JkLogFile "/usr/product/apache/httpd-2.2.11/logs/mod_jk.log"
JkLogLevel debug
JkOptions +FlushPackets

Dans ce fichier on récupère le port ajp13 qui sera déclaré dans le fichier virtualhost ...

Extrait fichier Worker.properties

# workers.properties -
#
# This file provides jk derived plugins with the needed information to
# connect to the different tomcat workers.  Note that the distributed
# version of this file requires modification before it is usable by a
# plugin.
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something
#
# Normally all you will need to do is un-comment and modify the first three
# properties, i.e. workers.tomcat_home, workers.java_home and ps.
# Most of the configuration is derived from these.
#
# When you are done updating workers.tomcat_home, workers.java_home and ps
# you should have 5 workers configured:
#
# - An ajp12 worker that connects to localhost:8007
# - An ajp13 worker that connects to localhost:8009
# - An ajp13 worker that connects to localhost:8809
# - A jni inprocess worker.
# - A load balancer worker
#
# However by default the plugins will only use the ajp12 worker. To have
# the plugins use other workers you should modify the worker.list property.
#
#

# OPTIONS ( very important for jni mode )

#
# workers.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
workers.tomcat_home=/users/tomcat/apache-tomcat-5.5.25

#
# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/usr/java/jdk1.5.0_17

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

#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#

#
#------ DEFAULT worker list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
# Add 'inprocess' if you want JNI connector
worker.list=rjal,sjal,sjaladmin


#
#------ DEFAULT ajp13 WORKER DEFINITIONS -----------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.list=sjaladmin
worker.sjaladmin.port=8209
worker.sjaladmin.host=localhost
worker.sjaladmin.type=ajp13

worker.list=rjal
worker.rjal.port=8109
worker.rjal.host=localhost
worker.rjal.type=ajp13

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

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
# worker.itomcat.lbfactor=1

# worker.jtomcat.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.itomcat.cachesize

Aucun commentaire:

Enregistrer un commentaire