Installation for Linux

Divert Installation (Tomcat on Linux)


Overview
Product Tour
Download
Installation
Registration
FAQs
Email


    

1. Download JDK or JRE from java.sun.com

The instruction assume you download JDK.
[root@web /root]# cd /usr/local
[root@web local]# tar -xzvf <download dir>/jdk-1_2_2_006-linux-i386_tar.gz
Replace <download dir> with the directory path of the location you downloaded JDK.
Try to run java to make sure there is no problem.
[root@web local]# /usr/local/jdk1.2.2/bin/java -version
java version "1.2.2"
Classic VM (build 1.2.2.006, green thread, nojit)

2. Download Tomcat from jakarta.apache.org

Download jakarta-tomcat-3.2.tar.gz or latest release from jakarta.apache.org

3. Expand the downloaded Tomcat tar file into /usr/local directory.

[root@web /root]# cd /usr/local
[root@web local]# tar xzvf <download dir>/jakarta-tomcat-3.2.tar.gz
[root@web /root]# cd jakarta-tomcat-3.2/bin
[root@web bin]# ./startup.sh
Replace <download dir> with the directory path of the location you downloaded Tomcat in previous step. Try to access Tomcat from a browser using port 8080. Suppose your webserver IP address is 200.201.202.203, try access http://200.201.202.203:8080/

4. Edit .bash_profile (of the unix user who is going start Tomcat)

JAVA_HOME=/usr/local/jdk1.2.2
PATH=$JAVA_HOME/bin:$PATH

export TOMCAT_HOME=/usr/local/jakarta-tomcat-3.2

export CLASSPATH=$TOMCAT_HOME/webapps/examples/servlets/divert.jar:$CLASSPATH
		

5. Publish Divert.html.

An example context is setup by default when you install Tomcat. The instruction here, publish
Divert.html in the example context. You can publish Divert.html in any other directory you choose.
If you publish in another directory please follow additional instruction here.
[root@web download]# PUBPATH=/usr/local/jakarta-tomcat-3.2/webapps/examples/servlets
[root@web download]# mv browser/divert.jar $PUBPATH
[root@web download]# mv browser/Divert.html $PUBPATH
DivertApplet is contained within divert.jar and Divert.html is use to pull it from the webserver.
DivertApplet need to locate DivertServlet on the Internet. The DivertServlet location is supplied
by java parameter ServletUrl. Edit Divert.html to supply ServletUrl value.

For examples,

If your webserver hostname is www.abc.com, set

<PARAM NAME = ServletUrl
       VALUE = "http://www.abc.com:8080/examples/servlet/DivertServlet" >
ServletUrl="http://www.abc.com:8080/examples/servlet/DivertServlet"
You can use IP address too. If your webserver IP address is 200.201.202.203, set
<PARAM NAME = ServletUrl
       VALUE = "http://200.201.202.203:8080/examples/servlet/DivertServlet" >
ServletUrl="http://200.201.202.203:8080/examples/servlet/DivertServlet"
Use your favorite editor to edit this value in Divert.html. Note that you need to edit 2 lines. One for IE
and the other is for Netscape.

6. Move the servlet classes files to example context

The instructions provided here place the servlets in example context. If you want place the servlets in
another context, please follow additional instructions here.
[root@web download]# SERVPATH=/usr/local/jakarta-tomcat-3.2/webapps/examples/WEB-INF/classes
[root@web download]# mv servlet/DivertServlet.class $SERVPATH
[root@web download]# mv servlet/z2Element.class $SERVPATH
[root@web download]# mv servlet/UpdParent.class	$SERVPATH
[root@web download]# mv servlet/UrlLoad.class $SERVPATH
[root@web download]# mv servlet/Cookies.class $SERVPATH
[root@web download]# mv servlet/a.class $SERVPATH
[root@web download]# mv linux/Validate.class $SERVPATH
[root@web download]# mv linux/Validate.properties $SERVPATH

7. Move libz2divert.so

libz2divert.so is a library. It is refered to by divert servlets classes.
[root@web download]# mkdir /usr/lib/divert
[root@web download]# mv linux/libz2divert.so /usr/lib/divert
Edit .bash_profile (see step 4 above) to add following line
export LD_LIBRARY_PATH=/usr/lib/divert:$LD_LIBRARY_PATH
If you prefer not to create /usr/lib/divert directory, you can move libz2divert.so your prefered directory.
You need to make sure LD_LIBRARY_PATH is pointing to the preferred directory.

8. Ftp Server

FTP server is use to validate divert users.
Divert users logon are passed to FTP server for verification. Edit Validate.properties to enter the port number if your FTP server is not using port 21.
[root@web /root]# ftp localhost
Try to logon to a user to make sure FTP server is OK.
Make sure your FTP server is up before you proceed.

If you prefer to have your own user validation, please follow the link here.

9. Start up TomCat.

Create a new terminal session (reboot if you have to). This is to ensure environment variable in .bash_profile
is effective.
[root@web /root]# echo $PATH
/usr/local/jdk1.2.2/bin:.....
[root@web /root]# echo $TOMCAT_HOME
/usr/local/jakarta-tomcat-3.2
[root@web /root]# echo $CLASSPATH
/usr/local/jakarta-tomcat-3.2/webapps/examples/servlets/divert.jar:......
[root@web /root]# echo LD_LIBRARY_PATH
/usr/lib/divert:.....
Echo the environment variables entered in step 4 and step 7 to make sure they are set. If they are not set, you need to enter them on the command line.
[root@web /root]# cd /usr/local/jakarta-tomcat-3.2/bin
[root@web bin]# ./startup.sh

10. Setup browsers

Proceed to set up your browsers to complete the installation