Procedure to install jserv and JSP support for Apache under Linux

Environment: Mandrake Linux 7.0, apache 1.3.12 with mod_so and php3_module
Installation includes: JDK 1.2.2, JDSK 1.2.2, ApacheJServ 1.1.2, GNUJSP

MAKE SURE that apxs is available, from apache-devel RPM.

  1. Install JDK 1.2
    Get JDK from and install by executing
    cd /usr/local; bzcat  | tar xvf -
    verify that /usr/local/jdk1.2.2/bin/jar works correctly (if it doesn't, the glib libraries are probably not installed or out of date)
  2. Install JSDK2.0
    Get JSDK2.0 from and install by
    cd /usr/local; tar xzvf 
  3. Install Jikes
    Jikes is a better java compilier from IBM. Get it from and install by
    rpm -Uvh jikes-1.06-1.i386.rpm
  4. Install Jserv
    Get JServ from and install by executing
    cd /usr/local; tar xzvf 
    cd /usr/local/Apache

    lots of lines of output, hopefully ending something like:
    Apache include flags:
    Default configuration files will be installed in:
    Default log files will be created in:
    Default servlets will be installed in:
    ApacheJServ.jar file will be installed in:
    Documentation will be installed in:
    Build classpath is:
    You might consider putting frequently used options into
    ./configure-options, one per line.
    +-STEP 1-------------------------------------------------------+
    |Run 'make; make install' to make a .jar file, compile the C   |
    |code and copy the appropriate files to the appropriate        |
    |locations.                                                    |
    +-STEP 2-------------------------------------------------------+
    |Put this line somewhere in Apache's httpd.conf file:          |
    |Include /etc/httpd/conf/jserv/jserv.conf
    |                                                              |
    |Then start Apache and try visiting the URL:                   |
    |                                                              |
    |If that works then you have successfully setup Apache JServ.  |
    |                                                              |
    |If that does not work then you should read the                |
    |troubleshooting notes referenced below.                       |
    |Html documentation is available in the docs directory.        |
    |                                                              |
    |Common Errors:                                                |
    |    Make sure that the log files can be written to by the     |
    |    user your httpd is running as (ie: nobody). If there are  |
    |    errors in your configuration, they will be logged there.  |
    |                                                              |
    |Frequently asked questions are answered in the FAQ-O-Matic:   |
    |                                                              |
    |                         |

    Now make and install the package by:
    make; make install

    add "Include /etc/httpd/conf/jserv/jserv.conf" to the end of the /etc/httpd/conf/httpd.conf file, restart Apache by apachectl restart
  5. Test operation of JServ
    use a web browser to go to http:///servlets/Hello

    A page should come up saying

    Example Apache JServ Servlet
    Congratulations, ApacheJServ 1.1.2 is working!

    from the same machine, you can open a browser to display the status of JServ at http://localhost/jserv

    If you want to check it from other systems, you must modify the permissions in the /etc/httpd/conf/jserv/jserv.conf file.

  6. Install GnuJSP
    get from and install by
    cd /usr/local; tar xzvf gnujsp-1.0.0.tar.gz
    cp /etc/httpd/conf/jserv/ /etc/httpd/conf/jserv/
    In the file, change the list of repositories to:
    and add these to the Servlet Aliases section:
    	-classpath %classpath%:%scratchdir%:
    	/usr/local/gnujsp-1.0.0/lib/gnujsp10.jar -d %scratchdir%
    	-deprecation %source%
    If using jikes, the initArgs line should read:
    	-classpath %classpath%:%scratchdir%:
    	-d %scratchdir% -deprecation %source%
    If it isn't obvious, the servlet.gnujsp.initArgs lines are a single line, not multiple lines as above shown for clarity! Change the "zones=root" line in the file to include the newly create "alph" zone, e.g. zones=root,alph
    and add a line to point to the properties file such as

    add to the /etc/httpd/conf/jserv/jserv.conf file:

    ApJServAction .jsp /alph/gnujsp     
    ApJServMount /alph /alph
    Make sure that the log files and scratch directory selected exist. Also verify that all .jar files are where you said they are. Restart Apache by apachectl restart
  7. Test operation of GnuJSP
    Copy the example files from the gnujsp/examples directory to a directory such as "myexamples" under your apache document root.

    in a browser, try bringing up a file such as http://yourhost/myexamples/hello.jsp

    You should get the Congratulations message. If you don't, go back and check the paths, syntax errors, etc.
    Unfortunately, the error logs are going to be fairly cryptic if you have a problem. Look at the jserv.log and mod_jserv.log files and you may get sufficient hints to correct any issues.