RE: Getting Apache2 forwarding to tomcat5

2005-10-12 Thread Richard Mixon
I believe that SuSE does not supply JK2, but only JK. And as another poster
said, JK2 is now deprecated.

I got the  RPM apache2-jakarta-tomcat-connectors working pretty easily as
I remember.
I moved from the RPM to a newer compiled version of JK version 1.2.14 a
couple of months ago to get newer features and better load balancing.

HTH - Richard

-Original Message-
From: Dan Chesmore [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 11, 2005 4:22 PM
To: Tomcat Users List
Subject: Getting Apache2 forwarding to tomcat5

I have read about 25 different websites on getting this setup. I have read
through this list trying to find the answer I need. I have spent the last 2
days and soon 3rd day trying to get this working. I need Apache to forward
port 80 and 443 requests to tomcat to 8080 and 8443. I am working on the
non-ssl right now. I get an error in Apache error_log
saying:
[error] uriEnv.init() map to invalid worker /*.jsp-0
ajp13:localhost:8009
[error] uriEnv.init() map to invalid worker /patientC
onnect-1 ajp13:localhost:8009

Let me give a bit of history and config files.
This is running on SLES9 x86-64 version.
Apache and tomcat and the connectors are from RPMs that came with SuSE.
Everything is installed in SuSE default install location.



httpd.conf.local:

LoadModule jk2_module /usr/lib64/apache2/mod_jk2.so

Location /*.jsp
JkUriSet worker ajp13:localhost:8009
/Location

Location /patientConnect
JkUriSet worker ajp13:localhost:8009
/Location


workers2.properties:

[logger]
level=DEBUG

[config:]
file=/etc/apache2/workers2.properties
debug=0
debugEnv=0

[uriMap:]
info=Maps the requests. Options: debug
debug=1

[shm]
info=Scoreboard. Required for reconfiguration and status with multiprocess
serve rs file=/usr/share/tomcat/logs/jk2.shm
size=1048576
debug=0
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=0

[status:]
info=Status worker, displays runtime informations

[uri:patientconnect.truchart.com/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket

# Define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[uri:patientconnect.truchart.com/patientConnect/*]
info=patientConnect



Both the workers2.properties and the httpd.conf.local are located in
/etc/apache2 directory.

In the /usr/share/tomcat/conf/ directory is the jk2.properties and the
server.xml

jk2.properties:

## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED ## WHEN
YOU EDIT THE FILE.

## COMMENTS WILL BE _LOST_

## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.

# Set the desired handler list
# handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
 channelSocket.port=8009
# Default:
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config  is working #
shm.file=${jkHome}/work/jk2.shm

# In order to enable jni use any channelJni directive # channelJni.disabled
= 0 # And one of the following directives:

# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so


# If set to inprocess the mod_jk2 will Register natives itself # This will
enable the starting of the Tomcat from mod_jk2 # apr.jniModeSo=inprocess


and the server.xml that was modified:


!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
Connector port=8080
   maxThreads=150 minSpareThreads=25
maxSpareThreads=75
   enableLookups=false redirectPort=8443
acceptCount=100
   debug=0 connectionTimeout=2
   disableUploadTimeout=true /
!-- Note : To disable connection timeouts, set connectionTimeout value
 to 0 --

!-- Note : To use gzip compression you could set the following
properti es :

   compression=on
   compressionMinSize=2048
   noCompressionUserAgents=gozilla, traviata
   compressableMimeType=text/html,text/xml
--


!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --
!--
Connector port=8443
   maxThreads=150 minSpareThreads=25
maxSpareThreads=75
   enableLookups=false disableUploadTimeout=true
   acceptCount=100 debug=0 scheme=https secure=true
   clientAuth=false sslProtocol=TLS /
--

!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
 Connector port=8009
   enableLookups=false redirectPort=8443 debug=0
   protocol=AJP/1.3 /


!-- Define a Proxied HTTP/1.1 Connector on port 8082 --
!-- See proxy documentation for more information about using this.
--
!--
Connector port=8082
   maxThreads=150 minSpareThreads=25
maxSpareThreads=75
   enableLookups=false
   acceptCount=100 debug=0 connectionTimeout=2
   proxyPort=80 disableUploadTimeout=true /
--

...

!-- Logger shared by all Contexts 

Re: Getting Apache2 forwarding to tomcat5

2005-10-12 Thread Dan Chesmore
Thank you very much. That did the trick.


On Tue, 2005-10-11 at 16:58 -0700, Lyndon Tiu wrote:
 Hello,
 
 
 1) It is recommended to use mod_jk version 1 as version 2 is deprecated and 
 anything that is new in version 2 has been rolled into version 1.
 
 
 2) All you need is this in server.xml:
 
  !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
   Connector port=8009
 enableLookups=false redirectPort=8443 debug=0
 protocol=AJP/1.3 /
 
 You may comment out the sections about 8080 and 8443 as apache talks to 
 tomcat through 8009.
 
 
 3) If you insist on using mod_jk version 2, here are sample config files that 
 worked for me:
 
 
 In httpd.conf:
 
 LoadModule jk2_module /usr/local/apache/modules/mod_jk2.so
 JkSet config.file /usr/local/apache/config/workers2.properties
 JkSet shm:file /usr/local/apache/logs/shm.file
 JkSet shm:size 1048576
 JkSet shm:disabled 0
 
 
 
 In workers2.properties:
 
 [channel.socket:server.domain.com:8009]
 info=Ajp13 forwarding over socket
 port=8009
 host=server.domain.com
 [ajp13:server.domain.com:8009]
 channel=channel.socket:server.domain.com:8009
 [uri:/*.jsp]
 worker=ajp13:server.domain.com:8009
 
 
 
 --
 Lyndon Tiu
 
 On Tue, 11 Oct 2005 18:22:21 -0500 tomcat-user@jakarta.apache.org wrote:
  I have read about 25 different websites on getting this setup. I have
  read through this list trying to find the answer I need. I have spent
  the last 2 days and soon 3rd day trying to get this working. I need
  Apache to forward port 80 and 443 requests to tomcat to 8080 and 8443. I
  am working on the non-ssl right now. I get an error in Apache error_log
  saying:
  [error] uriEnv.init() map to invalid worker /*.jsp-0
  ajp13:localhost:8009
  [error] uriEnv.init() map to invalid worker /patientC
  onnect-1 ajp13:localhost:8009
  
  Let me give a bit of history and config files.
  This is running on SLES9 x86-64 version.
  Apache and tomcat and the connectors are from RPMs that came with SuSE.
  Everything is installed in SuSE default install location.
  
  
  
  httpd.conf.local:
  
  LoadModule jk2_module /usr/lib64/apache2/mod_jk2.so
  
  Location /*.jsp
  JkUriSet worker ajp13:localhost:8009
  /Location
  
  Location /patientConnect
  JkUriSet worker ajp13:localhost:8009
  /Location
  
  
  workers2.properties:
  
  [logger]
  level=DEBUG
  
  [config:]
  file=/etc/apache2/workers2.properties
  debug=0
  debugEnv=0
  
  [uriMap:]
  info=Maps the requests. Options: debug
  debug=1
  
  [shm]
  info=Scoreboard. Required for reconfiguration and status with
  multiprocess serve
  rs
  file=/usr/share/tomcat/logs/jk2.shm
  size=1048576
  debug=0
  disabled=0
  
  [workerEnv:]
  info=Global server options
  timing=1
  debug=0
  
  [status:]
  info=Status worker, displays runtime informations
  
  [uri:patientconnect.truchart.com/jkstatus/*]
  info=Display status information and checks the config file for changes.
  group=status:
  
  [channel.socket:localhost:8009]
  info=Ajp13 forwarding over socket
  
  # Define the worker
  [ajp13:localhost:8009]
  channel=channel.socket:localhost:8009
  
  [uri:patientconnect.truchart.com/patientConnect/*]
  info=patientConnect
  
  
  
  Both the workers2.properties and the httpd.conf.local are located
  in /etc/apache2 directory.
  
  In the /usr/share/tomcat/conf/ directory is the jk2.properties and the
  server.xml
  
  jk2.properties:
  
  ## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
  ## WHEN YOU EDIT THE FILE.
  
  ## COMMENTS WILL BE _LOST_
  
  ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
  
  # Set the desired handler list
  # handler.list=apr,request,channelJni
  #
  # Override the default port for the socketChannel
   channelSocket.port=8009
  # Default:
  # channelUnix.file=${jkHome}/work/jk2.socket
  # Just to check if the the config  is working
  # shm.file=${jkHome}/work/jk2.shm
  
  # In order to enable jni use any channelJni directive
  # channelJni.disabled = 0
  # And one of the following directives:
  
  # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
  
  
  # If set to inprocess the mod_jk2 will Register natives itself
  # This will enable the starting of the Tomcat from mod_jk2
  # apr.jniModeSo=inprocess
  
  
  and the server.xml that was modified:
  
  
  !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
  Connector port=8080
 maxThreads=150 minSpareThreads=25
  maxSpareThreads=75
 enableLookups=false redirectPort=8443
  acceptCount=100
 debug=0 connectionTimeout=2
 disableUploadTimeout=true /
  !-- Note : To disable connection timeouts, set connectionTimeout
  value
   to 0 --
  
  !-- Note : To use gzip compression you could set the following
  properti
  es :
  
 compression=on
 compressionMinSize=2048
 noCompressionUserAgents=gozilla, traviata

Re: Getting Apache2 forwarding to tomcat5

2005-10-11 Thread Lyndon Tiu
Hello,


1) It is recommended to use mod_jk version 1 as version 2 is deprecated and 
anything that is new in version 2 has been rolled into version 1.


2) All you need is this in server.xml:

 !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
  Connector port=8009
enableLookups=false redirectPort=8443 debug=0
protocol=AJP/1.3 /

You may comment out the sections about 8080 and 8443 as apache talks to tomcat 
through 8009.


3) If you insist on using mod_jk version 2, here are sample config files that 
worked for me:


In httpd.conf:

LoadModule jk2_module /usr/local/apache/modules/mod_jk2.so
JkSet config.file /usr/local/apache/config/workers2.properties
JkSet shm:file /usr/local/apache/logs/shm.file
JkSet shm:size 1048576
JkSet shm:disabled 0



In workers2.properties:

[channel.socket:server.domain.com:8009]
info=Ajp13 forwarding over socket
port=8009
host=server.domain.com
[ajp13:server.domain.com:8009]
channel=channel.socket:server.domain.com:8009
[uri:/*.jsp]
worker=ajp13:server.domain.com:8009



--
Lyndon Tiu

On Tue, 11 Oct 2005 18:22:21 -0500 tomcat-user@jakarta.apache.org wrote:
 I have read about 25 different websites on getting this setup. I have
 read through this list trying to find the answer I need. I have spent
 the last 2 days and soon 3rd day trying to get this working. I need
 Apache to forward port 80 and 443 requests to tomcat to 8080 and 8443. I
 am working on the non-ssl right now. I get an error in Apache error_log
 saying:
 [error] uriEnv.init() map to invalid worker /*.jsp-0
 ajp13:localhost:8009
 [error] uriEnv.init() map to invalid worker /patientC
 onnect-1 ajp13:localhost:8009
 
 Let me give a bit of history and config files.
 This is running on SLES9 x86-64 version.
 Apache and tomcat and the connectors are from RPMs that came with SuSE.
 Everything is installed in SuSE default install location.
 
 
 
 httpd.conf.local:
 
 LoadModule jk2_module /usr/lib64/apache2/mod_jk2.so
 
 Location /*.jsp
 JkUriSet worker ajp13:localhost:8009
 /Location
 
 Location /patientConnect
 JkUriSet worker ajp13:localhost:8009
 /Location
 
 
 workers2.properties:
 
 [logger]
 level=DEBUG
 
 [config:]
 file=/etc/apache2/workers2.properties
 debug=0
 debugEnv=0
 
 [uriMap:]
 info=Maps the requests. Options: debug
 debug=1
 
 [shm]
 info=Scoreboard. Required for reconfiguration and status with
 multiprocess serve
 rs
 file=/usr/share/tomcat/logs/jk2.shm
 size=1048576
 debug=0
 disabled=0
 
 [workerEnv:]
 info=Global server options
 timing=1
 debug=0
 
 [status:]
 info=Status worker, displays runtime informations
 
 [uri:patientconnect.truchart.com/jkstatus/*]
 info=Display status information and checks the config file for changes.
 group=status:
 
 [channel.socket:localhost:8009]
 info=Ajp13 forwarding over socket
 
 # Define the worker
 [ajp13:localhost:8009]
 channel=channel.socket:localhost:8009
 
 [uri:patientconnect.truchart.com/patientConnect/*]
 info=patientConnect
 
 
 
 Both the workers2.properties and the httpd.conf.local are located
 in /etc/apache2 directory.
 
 In the /usr/share/tomcat/conf/ directory is the jk2.properties and the
 server.xml
 
 jk2.properties:
 
 ## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
 ## WHEN YOU EDIT THE FILE.
 
 ## COMMENTS WILL BE _LOST_
 
 ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
 
 # Set the desired handler list
 # handler.list=apr,request,channelJni
 #
 # Override the default port for the socketChannel
  channelSocket.port=8009
 # Default:
 # channelUnix.file=${jkHome}/work/jk2.socket
 # Just to check if the the config  is working
 # shm.file=${jkHome}/work/jk2.shm
 
 # In order to enable jni use any channelJni directive
 # channelJni.disabled = 0
 # And one of the following directives:
 
 # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
 
 
 # If set to inprocess the mod_jk2 will Register natives itself
 # This will enable the starting of the Tomcat from mod_jk2
 # apr.jniModeSo=inprocess
 
 
 and the server.xml that was modified:
 
 
 !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
 Connector port=8080
maxThreads=150 minSpareThreads=25
 maxSpareThreads=75
enableLookups=false redirectPort=8443
 acceptCount=100
debug=0 connectionTimeout=2
disableUploadTimeout=true /
 !-- Note : To disable connection timeouts, set connectionTimeout
 value
  to 0 --
 
 !-- Note : To use gzip compression you could set the following
 properti
 es :
 
compression=on
compressionMinSize=2048
noCompressionUserAgents=gozilla, traviata
compressableMimeType=text/html,text/xml
 --
 
 
 !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --
 !--
 Connector port=8443
maxThreads=150 minSpareThreads=25
 maxSpareThreads=75
enableLookups=false