Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Apache JServ 1.0 : (Category) Installation : (Category) Unix :
Paul Russo's Installation Instructions on Linux RedHat 5.2
Steps I took to get Java servlets to run under the Apache web server
Linux RedHat 5.2

Download the following distributions into /usr/local/src
Distributions Location
Apache-JServ-1.0b3 http://java.apache.org (Servlet to run on Apache)
JSDK2.0 http://java.sun.com (Java Server Deveolpment Kit)
Apache_1.3.4 http://www.apache.org (Latest Appache web server)
JDK117_v1a or JDK1.2 (pre-release) http://www.blackdown.org (Linux port of JDK)

gunzip and untar the .gz files from /usr/local/src using: tar xvzf 'name'.gz

We need to set some environmental variables
Since I use bash logon shell, I set them in .bash_profile

Paths to set in .bash_profile
JAVA_HOME=/usr/local/src/jdk1.2
JSDK_HOME=/usr/local/src/JSDK2.0

For JDK < 1.2
CLASSPATH=$JAVA_HOME/lib/classes.zip:$JSDK_HOME/lib/jsdk.jar
For JDK = 1.2
CLASSPATH=$JSDK_HOME/lib/jsdk.jar
PATH=$JAVA_HOME/bin:$JSDK_HOME/bin:$PATH
Append path last because jar, java and javac also exist in /usr/bin!!

export PATH JAVA_HOME CLASSPATH

Logout then logon to have the paths set
Test the path settings:
# java -version
# servletrunner

If it looks ok then we can configure jserv.
# cd /usr/local/src/Apache-JServ-1.0b3
# ./configure --prefix=/usr/local/etc/jserv;make;make install

This should complete successfully if the paths are
properly set.

Created directories
/usr/local/etc/jserv
/usr/local/etc/jserv/doc
/usr/local/etc/jserv/lib

and the file /usr/local/etc/jserv/lib/Apache-JServ.jar

Now we need to compile Apache with servlet support.

  1. Copy the jserv modules to the Apache source extra modules directory
    # cp /usr/local/src/Apache-JServ-1.0b3/src/c/*.* /usr/local/src/apache_1.3.4/src/modules/extra
  2. Compile Apache using the following options
    # cd /usr/local/src/apache_1.3.4
    # ./configure --prefix=/home/apache --add-module=src/modules/extra/mod_jserv.c --enable-shared=jserv --enable-module=jserv
    # make;make install

Changes to configuration files

Append /usr/local/src/Apache-JServ-1.0b3/conf/http.conf.in to APACHE_DIR/conf/http.conf

Modify APACHE_DIR/conf/http.conf

  1. Modify ApJServProperties to point to the jserv.properties file
  2. Modify ApJServMount to point to a zone when requesting http://host/servlet/myServlet
    ApJServMount /servlet /zone1

Modify jserv.properties file

  1. zones=zone1
  2. zone1.properties=PATH TO zone1.properties
  3. log.file = a place for the log file with a 777 mode (JDK1.2)

Modify zone1.properties

  1. repositories=PATH TO A SERVLET
  2. repositories=PATH TO ANOTHER SERVLET
  • Start apache /home/apache/bin/apachectl start
  • Include apache /home/apache/bin/apachectl start in /etc/rc.d/rc.local
  • Email
    Subcategories:

    Answers in this category:

    [Append to This Answer]
    Previous: (Answer) Can you show me an example *working* configuration?
    Next: (Answer) Compiling Apache 1.2.6 with JServ 1.0
    This document is: http://java.apache.org/faq/?file=66
    [Search] [Appearance] [Show Expert Edit Commands]
    This is a Faq-O-Matic 2.709.
    Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.