6. Server Side Java

6.1. mod_jserv

6.1.1. What is mod_jserv

Quoting java.apache.org

Apache JServ is a 100% pure Java servlet engine fully compliant with theJavaSoft Java Servlet APIs 2.0 specification. Since we believe in the great value complete portability between different servlet platforms, together with portability of Java binary code, we worked very close with JavaSoft and other JVM implementers to provide correct interpretations or Java specifications both for servlets and for the Java language itself. mod_jserv is very comfortable to maintain (unusally Java is the HELL, jserv is a little nicer :-)

Unfortunatyl mod_jserv is no longer actively developped, only bugfixes if bugs where found. Tomcat is the successor of mod_jserv As soon as the author gets enought time and experiance with Tomcat he will extend this HOWTO.

JDSK2.0 is out of Date too. Its needed for mod_jserv only.

6.1.2. Prerequisites

6.1.2.1. JSDK 2.0 (mod_jserv req.)

6.1.2.1.1. What is JSDK

Its the API from Sun Microsystems for developping Servlets

6.1.2.1.2. Download

Origin-Site: http://java.sun.com/products/servlet/archive.html

6.1.2.1.3. Building and installing

Since JSDK is closedsource there is nothing to build.

Notice: The filename “jsdk20-solaris2-sparc.tar.Z” suggests to be a binary for sparc platform -> ignore it, it will work on all platforms


cd /usr/local/ 

uncompress jsdk20-solaris2-sparc.tar.Z
tar -xvf jsdk20-solaris2-sparc.tar

6.1.3. Download the source

Origin-Site: http://java.apache.org/jserv/dist/

6.1.4. Building and installing


cd /usr/local

tar -xvzf ApacheJServ-1.1.2.tar.gz
cd ApacheJServ-1.1.2

./configure \
--prefix=/usr/local/jserv \
--with-apxs=/usr/local/apache/bin/apxs \
--with-JSDK=/usr/local/JSDK2.0 \
--enable-EAPI \

make
make install

Its important to use flag --enable-EAPI if apache is compiled with mod_ssl!

6.2. jakarta-tomcat

6.2.1. What is Tomcat

Quoting jakarta.apache.org

Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.

From the authors point of view: Tomcat is the successor of jserv which is no longer developped. Tomcat supports the latest jsp and servlet-API's defined by sun. Unfortunatly is very difficult to build from source, because its using its own building-system called "ant". There is also a very long list of prerequesits if you want to build from source. See http://jakarta.apache.org/tomcat/tomcat-4.0-doc/BUILDING.txt for more details - Good luck, and give some feedback to the author. In meantime the HOWTO is providing some basic support for Tomcat installed from binaries.

The Author is searching for some volunteers who tries to build Tomcat from source and tells what steps are required

6.2.2. Prerequisites

6.2.2.1. Java2

6.2.2.1.1. What is Java2>

Quoting java.sun.com

Too much for this HOWTO, please see http://java.sun.com/j2se/1.3/docs/relnotes/features.html

6.2.2.2. Download the binaries

Go to http://java.sun.com/j2se/1.3/ ,choose your platform and follow the steps on the site.

6.2.2.3. Installing the binaries

Now you have to execute the binary:


chown +x j2sdk-1_3_1_02-linux-i386.bin

./2sdk-1_3_1_02-linux-i386.bin

After accepting the license you cat unpack the stuff und move to "/usr/lib"

6.2.3. Download the binaries

Origin-Site: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.1/bin/jakarta-tomcat-4.0.1.tar.gz/

6.2.4. Installing the binaries


cd /usr/local

tar -xvzf jakarta-tomcat-4.0.1.tar.gz

cd jakarta-tomcat-4.0.1

cd bin

rm *.bat

echo export JAVA_HOME=/usr/lib/java/ >> /etc/profile
. /etc/profile

Now you should be able to startup tomcat:


/usr/local/apache/jakarta-tomcat-4.0.1/bin/startup.sh

You should now be able to connect to: http://localhost:8080/index.html

Now for the further steps like installing your servlets and jps-files you are responsible by youself...

Notice: Since the author is NOT a Java-Programmer he will be able to help you with Java-Problems! The author is an experianced SysAdmin and could you give some hints: Be sure your CLASSPATH Variable is set right! This is most common error done! Have fun, and as metioned above, the author requests some feedback to be able to provide more informations to the community