Site navigation below

In this section

Place your text ad here.

Web hosting directory, find affordable web hosting

Dedicated Server Hosting and Reseller Web Hosting

Data recovery software tools & file recovery utilities to recover lost data

WestNIC provides reliable web hosting services

Brand Protection

SGD Networks offers Web Hosting, Web Hosting Hyderabad

Award Winning PST Repair and Mail Recovery Software

Mortgage Calculator

Apache JServ is a Java servlet engine which can be integrated with the Apache Web server to run servlets. It is not difficult to configure JServ to run on a local development machine, but the standard documentation does not explain the process very clearly. This article explains how to set up JServ to work with Apache Web server under the Windows operating systems.

This installation guide also applies to Windows 98 and Windows ME operating systems.

Software requirements

The essential components for running Apache JServ are listed below. The software is all available free of charge and should be installed in the order specified:

  1. The latest version of the Apache Web server for Windows; this article is based on version 1.3.20. Note some significant changes to the binary distribution of the Apache server for versions 1.3.17 and later, which will require additional free Windows Installer applications.
  2. Java 2 Software Development Kit (SDK), version 1.2.2 or higher from Sun Microsystems. This was formerly known as the Java Development Kit or JDK.
  3. Java Servlet Development Kit (JSDK) version 2.0, also from Sun Microsystems. This is not the same as the Java 2 SDK. Only version 2.0 works with Apache JServ.
  4. The Apache JServ servlet engine from the Java Apache site

Apache Web server installation

The installation of the Apache Web server on Windows systems is very simple and well documented. This article assumes you already have the server up and running as http://localhost/ in advance, the illustrated notes below summarise the process.

Installation path

It is recommended that you install Apache Web server in a directory path with short directory names and no spaces. For instance, the path c:\apache\httpd will make JServ configuration much easier.

Installation steps

  1. Welcome to the installation wizard.
  2. Accept the License Agreement.
  3. You are advised to Read This First.
  4. Enter the default Server Information, including host server name.
  5. Choose the complete or custom Setup Type.
  6. Select the Destination Folder.
  7. At this stage you should be Ready to Install the Program.
  8. The next dialogue displays progress Installing Apache httpd Server.
  9. Installation Completed

Java 2 SDK installation

This article also assumes that you have installed the Java 2 Software Development Kit (SDK) in advance, and the Java executable is included in the system PATH variable via an autoexec.bat command (see below).

Java Servlet Development Kit installation

Apache JServ requires the Java Servlet Development Kit (JSDK) 2.0 and only this version will work. The JSDK typically installs to the directory c:\jsdk2.0. The path to the Java archive jsdk.jar should also be added to the system CLASSPATH environment variable via an autoexec.bat command (see below).

JSDK 2.0 installation steps

  1. The Welcome dialogue.
  2. Next, Choose Destination Location.
  3. Finally, Setup Complete.

Apache JServ installation

The self-extracting JServ installation program will prompt you to specify the installation directories for the Apache Web server, the Java virtual machine (JVM), java.exe, and the JSDK Java archive, jsdk.jar. The program will also ask if you want to change the Apache Web server configuration file, httpd.conf to include the JServ module; you should accept this option.

Installation paths

As with the Apache Web server, it is recommended that you install Apache JServ in a path with short directory names and no spaces. For instance, the path c:\apache\jserv will make JServ configuration much easier.

Apache JServ installation steps

  1. Welcome to Apache JServ 1.1.2 installation.
  2. Accept the Software License Agreement.
  3. Choose Destination Location for JServ.
  4. Choose the full, compact or custom Setup Type.
  5. Select the Java Virtual Machine directory.
  6. Select the Servlet Development Kit 2.0 directory.
  7. Accept the Apache Configuration option.
  8. Select the Apache installation directory, that is the standard Web server.
  9. Finished.

Configuration files

After the JServ installation program has completed, you will need to edit the server configuration files manually to make all the Windows paths specified during the installation compatible with the Apache Web server. The Windows system uses directory paths with back slashes, \, the Apache configuration files must use Unix-style forward slashes, /.

Before you edit the following files, save a backup copy for reference.

System configuration: autoexec.bat

First, add the path to the JServ Java archive to the system CLASSPATH environment variable with a further autoexec.bat command. The complete example below includes the PATH and CLASSPATH commands described above for the Java 2 SDK and JSDK installations and may be copied and pasted if the same paths have been used:

REM Set path for Java Software Development Kit
SET PATH=C:\jdk1.2.2\bin

REM Set classpath for Java Servlet Development Kit
SET CLASSPATH=%classpath%;c:\jsdk2.0\lib\jsdk.jar

REM Set classpath for Apache JServ
SET CLASSPATH=%classpath%;c:\apache\jserv\apache~1.jar
      

Note that because the JServ archive uses a "long" file name, ApacheJServ.jar, the Windows system requires its shortened "8.3" format name in the CLASSPATH setting: apache~1.jar. You will need to re-start your computer for these settings to take effect.

Apache Web server configuration: httpd.conf

The JServ installer will have added a line at the bottom of the Apache Web server's configuration file, httpd.conf, to include the new JServ module. However, the path specified will use Windows standard back slashes. Apache server expects forward slashes and this file must be edited accordingly, e.g.:

# Changed default back slashes to forward slashes
Include "c:/apache/jserv/conf/jserv.conf"
      

Apache JServ configuration: jserv.conf

The JServ installer program will also have hard coded the various installation options into its own configuration file and these will need to be changed. The following three configuration lines occur separately in jserv.conf:

# Changed default back slashes to forward slashes
LoadModule jserv_module "c:/apache/jserv/ApacheModuleJServ.dll"

# Changed default back slashes to forward slashes
ApJServProperties "c:/apache/jserv/conf/jserv.properties"

# Changed default back slashes to forward slashes
ApJServLogFile "c:/apache/jserv/logs/mod_jserv.log"
      

Apache JServ configuration: jserv.properties

Again, the JServ installer hard codes Windows back slashes into the JServ properties configuration and these must be changed throughout the file. The JServ FAQ also recommends adding a wrapper environment reference to the Windows directory, e.g.:

# Default back slashes changed to forward slashes
wrapper.bin=c:/jdk1.2.2/bin/java.exe

# Default back slashes changed to forward slashes
wrapper.classpath=c:/apache/jserv/ApacheJServ.jar
wrapper.classpath=c:/JSDK2.0/lib/jsdk.jar

# Added per FAQ with forward slash
wrapper.env=windir=c:/windows

# Default back slashes changed to forward slashes
root.properties=c:/apache/jserv/servlets/zone.properties

# Default back slashes changed to forward slashes
log.file=c:/apache/jserv/logs/jserv.log
      

Apache JServ configuration: zone.properties

Finally, the default servlet zone's property configuration must be converted to use forward slashes too. Only one line must be changed:

# Default back slashes changed to forward slashes
repositories=c:/apache/jserv/servlets
      

Configuration complete

Having made all the changes detailed above, JServ will be ready to run in its default state with the existing Apache Web server installation. When Apache starts, it should automatically start the JServ servlet engine and forward requests made to the standard servlet paths /servlet/ and /servlets/. The JServ installation comes with a test servlet that you can use to check your installation is running correctly at http://localhost/servlets/IsItWorking.

Frequently asked questions

Follow the links below for answers to common questions about Java servlet containers. See also, Apache Tomcat FAQ.

Article feedback

Your comments on this article will be appreciated, please use the form below to submit your views. If you would like a reply or article update notification, include your email address.

Information: Your email address will not be mis-used. If you include your address you may be sent a personal reply, you will not be added to any mailing list unless you request update notification. Read the site privacy statement for details.

Add this page to your chosen social bookmarking service

Style warning - please read

Home · CSS · Java · Javascript · HTML · Help · Log