Web hosting directory, find affordable web hosting
Data recovery software tools & file recovery utilities to recover lost data
WestNIC provides reliable web hosting services
SGD Networks offers Web Hosting, Web Hosting Hyderabad
Award Winning PST Repair and Mail Recovery Software
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.
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:
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.
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.
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).
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).
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.
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.
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.
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.
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"
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"
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
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
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.
Follow the links below for answers to common questions about Java servlet containers. See also, Apache Tomcat FAQ.
web.xml for?
web.xml for each server?