Setting Tomcat3.1 with Apache > jserv.conf(or tomcat.conf)
Previous Page Contents Next Page
OOP-Reserch home page

Mail to Me

jserv.conf(or tomcat.conf)

Any questions and comments are welcome to me.

The path for this configuration file must be pointed by 'Include' directive in 'httpd.conf'. Tomcat3.1 binary distribution includes the template of this file, which is $TOMCAT_HOME/conf/tomcat.conf. This file describes how the JServ module is configured. The following is the example of this file with some explanation.

<IfModule mod_jserv.c>

# 'off' menas the JServ module start the corresponding
# servlet server when Apache start.
# The class name of the servlet server is specified in
# the property file for the JServ module.
# (See the next entry.)
# Now we can start the Tomcat server from the JServ module,
# so it can be 'off'.
ApJServManual off

# The path to the property file for the JServ module.
# In this file, we can specify the class name of the
# servlet server, the path to Java compiler, the class path
# which is passed to Java compiler and so on.
# Yes, this file tells the JServ module how to start servet
# server(Tomcat).
# We can specify 'org.apache.tomcat.startup.Tomcat'
# as the starter class in this file.
# Tomcat3.1 binary distribution includes the template of this
# file, which is $TOMCAT_HOME/conf/tomcat.properties.
ApJServProperties /export/home/soft/lib/java2/jakarta-tomcat/conf/jserv.properties

# The path to log file for the JServ module.
# Relative to the path specified by 'ServerRoot' directive
# in 'httpd.conf'.
ApJServLogFile ./logs/mod_jserv.log

# The log level for the JServ module.
ApJServLogLevel debug

# The protocol of the communication between the JServ
# module and the servlet server.
ApJServDefaultProtocol ajpv12

# The host name of the servlet server.
ApJServDefaultHost jun_tomcat

# The port which the servlet server linstens to.
ApJServDefaultPort 8007

# The timeout before the JServ module starts to 'ping'
# to the servlet server.
# In case that the first 'ping' fails, the JServ module
# sends the 'kill' signal to the servlet server and tries
# to restart it.
ApJServVMTimeout 40

# The secret key used in communicating with the servlet
# server.
ApJServSecretKey DISABLED

# All the request with '.jsp' extention should be 
# redirected to the servlet server by the JServ module.
AddType text/jsp .jsp
AddHandler jserv-servlet .jsp

# This means that the request such as
#     http://www.foo.com/jun_app/myservlet
# is handled by the JServ module and redirected to the Tomcat
# server. Of cource, Tomcat must listen to the port 8007 on
# the host 'jun_tomcat' for 'AJP12' protocol.
# The Tomcat server will start 'myservlet'
# in the context of '/jun_app'.
ApJServMount /jun_app ajpv12://jun_tomcat:8007/jun_app

# 'on' means that the mappings between the mount point and
# the context, which are specified by 'ApJServMount'
# directive in this file, are applied also to the Virtual
# host. So the request to the virtual host such as
#     http://www.juntest.com/jun_app/myservlet
# (Note tha http://www.juntest.com is the virtual host!)
# is also redirected to Tomcat, even though the mapping between
# /jun_app and ajpv12://jun_tomcat:8007/jun_app
# is not defined in the 'VirtualHost' directive 
# in httpd.conf .
ApJServMountCopy on

# This means that if the request uri starts with '/jserv/',
# the request must be handled by the 'jserv-status'
# function of the JServ module.
# The 'jserv-status' writes out the HTML string
# representing the configuration status of the JServ module.
# Some of the requests are redirected to the special
# servlet, which generates the HTML string representing
# the status of the servlet server.
# It is desirable to restrict the access to this path.
<Location /jserv/>
  SetHandler jserv-status
  order deny,allow
  deny from all
  allow from your_host
</Location>

# The 'jserv-status' function of the JServ module redirects
# some request to the special servlet to obtain the
# configuration status of the servlet server.
# The name of this special servlet is 
#	'org.apache.jserv.JServ'
# and this servlet resides in the context of '/engine'.
# For the servlet server to handle the request to the servlet of
#	'org.apache.jserv.JServ'
# in the context of '/engine', the following mapping
# is required.
ApJServMount /engine ajpv12://jun_tomcat:8007/engine

# The access to this mount path should be restricted.
<Location /engine>
  order deny,allow
  deny from all
  allow from your_host
</Location>
<Location /engine/WEB-INF/ >
  AllowOverride None
  deny from all
</Location>  

</IfModule>

The next step is to specify how the Tomcat servlet server is started. Such a configuration is done by 'jserv.properties'.

Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.


Previous Page Contents Next Page
OOP-Reserch home page

Mail to Me


ALL CONTENTS COPYRIGHT 2000 , Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori .