Help - Search - Members - Calendar
Full Version: [HOW-TO]Install Tomcat 3.3a ENSIM
The Planet Forums > Control Panels > Ensim > Ensim HOWTOs
Robert C
Tomcat 3.3a installation guide [ENSIM]:

Note: This guide is only for Tomcat3.3a, and it may not work for tomcat3.2.x or tomcat4.0

Step One: Install the java 1.3.1 SDK

1) Download the RPM shell script for JAVA1.3.1 SDK

http://java.sun.com/j2se/1.3/download-linux.html

wget ftp://207.240.117.146/pub/j2sdk/1.3.1/oei...ux-i386-rpm.bin
wget ftp://ftp.java.sun.com/pub/j2sdk/1.3.1/oe...ux-i386-rpm.bin
wget ftp://128.11.158.66/pub/j2sdk/1.3.1/oeiqt...ux-i386-rpm.bin

Whichever works. I am just trying to make it simple for you.

2) Follow the instructions on this page to install the java SDK

http://java.sun.com/j2se/1.3/install-linux...tml#install-pkg

chmod a+x j2sdk-1_3_1_02-linux-i386-rpm.bin
./j2sdk-1_3_1_02-linux-i386-rpm.bin
su
rpm -iv jdk-1.3.1_02.i386.rpm

3) Update the PATH enviroment variable, open the file "/etc/profile" and add
these two lines after the line: HISTSIZE:1000

JAVA_HOME=/usr/java/jdk1.3.1_02; export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH; export PATH

pico /etc/profile



Step Two: install the tomcat 3.3a server

1) Download the tomcat distribution "jakarta-tomcat-3.3a.tar.gz"

wget http://jakarta.apache.org/builds/jakarta-t...cat-3.3a.tar.gz

2) Copy the file "jakarta-tomcat-3.3a.tar.gz" file to /usr/java/

cp /home/admin/jakarta-tomcat-3.3a.tar.gz /usr/java/jakarta-tomcat-3.3a.tar.gz
cd /usr/java/

3) Untar the file, execute the command

tar -xzvf jakarta-tomcat-3.3a.tar.gz

4) a new directory "jakarta-tomcat-3.3a" will be created.

/usr/java/jakarta-tomcat-3.3a will be your tomcat installation directory.

5) Setting the TOMCAT_HOME enviroment variable, add this line to "/etc/profile"

TOMCAT_HOME=/usr/java/jakarta-tomcat-3.3a; export TOMCAT_HOME

Step Three: Configuring Tomcat:


You will need to edit the file

/usr/java/jakarta-tomcat-3.3a/conf/jk/workers.properties

1) search for workers.java_home', and make it point to your java installation directory, example

# workers.java_home=c:jdk1.3
workers.java_home=/usr/java/jdk1.3.1_02

2) setting the path sparator for your OS, search for "ps", and use the one that is for your OS.

# ps=
ps=/

3) tell tomcat which JVM to use. Search for 'worker.inprocess.jvm_lib', and choose the one that is for your OS. Example, if you are using unix/linux, then

# Windows
# worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jv
.dll
# IBM JDK1.3
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)l
bjvm.so
# Unix - Sun VM or blackdown
worker.inprocess.jvm_lib=$(workers. java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)classic$(p
s)libjvm.so

Done with the file.

Step Four: Apache-tomcat integration:


1) Download the mod_jk.so module from

http://jakarta.apache.org/builds/jakarta-t...bin/linux/i386/

wget http://jakarta.apache.org/builds/jakarta-t...p13-eapi.so.asc

The one I am using is "mod_jk-3.3-ap13-eapi.so", from the file name, you can see that this module is for integrating tomcat3.3 with apache 1.3.

3) Copy the file "mod_jk-3.3-ap13-eapi.so" to /etc/httpd/modules/ and rename the file to mod_jk.so

cp /home/admin/mod_jk-3.3-ap13-eapi.so /etc/httpd/modules/mod_jk-3.3-ap13-eapi.so
cd /etc/httpd/modules/
cp mod_jk-3.3-ap13-eapi.so mod_jk.so
rm -fr mod_jk-3.3-ap13-eapi.so

4) Edit the httpd.conf, put the line below at the end of your "/etc/httpd/conf/httpd.conf" file

pico /etc/httpd/conf/httpd.conf


Include /usr/java/jakarta-tomcat-3.3a/conf/jk/mod_jk.conf


This will tell apache to include the configuration in mod_jk.conf.
Everytime when you start tomcat, it will generate a file named "mod_jk.conf" under /usr/java/jakarta-tomcat-3.3/conf/auto/.

Then:

pico /usr/java/jakarta-tomcat-3.3/conf/jk/mod_jk.conf
and in the line change the .dll extension to .so
so it should look like this mod_jk.so instead of mod_jk.dll
and put the full path name below:
EX: /usr/java/jakarta-tomcat-3.3/conf/jk/ where it asks for it.

5) Edit the tomcat configuration file. "/usr/java/jakarta-tomcat-3.3a/conf/server.xml"

a) Tell the tomcat to use the mod_jk module for connecting to apache

change the line



to




b) forward only jsp and servlet requests to tomcat, and let the apache to handle static contents

change the line


to




c) comment these lines since you are not using microsoft IIS and Netscape server




Step Five: Configuring virtual hosts


1) To enable a virtual host to use jsp/servlets, you need to create a file with
pattern "apps-mydomain.com.xml" under "/usr/java/jakarta-tomcat-3.3a/conf/"
for that domain. Here is an example:














Explained by wht:

"In the above configuration, a defines a web application, so there are 4 java web applications for this domain1.com. Each web application has a path(it affects how you access the pages for that webapp through URL) and a docBase(where your WEB-INF directory should be). Make sure you use absolute path for docBase, otherwise it will put your WEB-INF under tomcat's webaps directory $TOMCAT_HOME/webapps
Here is the corresponding direcotry structure and URL maping for the setting above.
default application:

WEB-INF dir: /home/virtual/site1/fst/var/www/html/WEB-INF
URL: http://www.domain1.com/hello.jsp
app1:

WEB-INF dir: /home/virtual/site1/fst/var/www/html/app1/WEB-INF
URL: http://www.domain1.com/app1/hello.jsp
app2:

WEB-INF dir: /home/virtual/site1/fst/var/www/html/Catalog/WEB-INF
URL: http://www.domain1.com/app2/hello.jsp
app3:

WEB-INF dir: /home/virtual/site1/fst/var/www/html/Catalog/WEB-INF
URL: http://www.domain1.com/app3/hello.jsp
Note that app2 and app3 have the same docBase, this fools the visitor to think app2 is a different directory from app3 in your filesystem.
Another Note: The WEB-INF directory are not automatically created, you will have to create it under the docBase or let the domain owner to do it by himself."


Step Six: Starting the tomcat and apache server:

Make sure you start tomcat before apache.

To start tomcat server, execute

/usr/java/jakarta-tomcat-3.3a/bin/startup.sh

To stop tomcat, execute

/usr/java/jakarta-tomcat-3.3a/bin/shutdown.sh

start apache:

/etc/rc.d/init.d/httpd start

stop apache:

/etc/rc.d/init.d/httpd stop

Additional information:

1. Tomcat 3.3 documentation:

http://jakarta.apache.org/tomcat/tomcat-3.3-doc/

Now if someone could please help me on this:
http://forum.rackshack.net/showthread.php?...=&threadid=4158
That is all I ask in return.
Robert C
Hopefully the webalizer how to I will have it tomorrow.
Robert C
Forgot to add this, before you start TOMCAT, well if you get errors starting it:

wget ftp://rpmfind.net/linux/redhat/7.1/en/os/...9.0.14.i386.rpm

rpm --install compat-libstdc++-6.2-2.9.0.14.i386.rpm

And try again.
vladgur
Excellent how-to, worked without a glitched and passed "helloworld.jsp tests icon_smile.gif
mouse
Moved to RackShack Talk > General Forums > HOW-TOs >

Great looking how-to btw.. Mouse
PaulEsch
Can someone add the "How to have Tomcat start up after a reboot."?

I can't imagine going to the trouble of installing the service but yet rely on a manual startup.

Thanks,
Paul

ps. I got my servlet engine working with wht's instructions last month. And I still have to manually start Tomcat after a reboot icon_sad.gif
xeosdd
QUOTE
Can someone add the "How to have Tomcat start up after a reboot."?
I'm not up to there yet, but I'd guess it's a matter of adding it to your /etc/rc.d/rc.local file (under Redhat)... or where ever this file lives on other systems...



Simon

[edit]
I've finally got arround to installing Tomcat on our box, and I had significantly more success with Tomcat 3.3.1. With 3.3a (as provided in the links above), I wasn't getting the same status info that I'm used to on startup, and anything ending in .jsp gave me those wonderful "Internal Server Error" messages. Tomcat 3.3.1 installed seamlessly, configured seamlessly (it even told me what I'd forgotten!), and runs beautifully. Time to buy more RAM for my home machine so I can use NetBeans... icon_sad.gif

As for Tomcat 4.x, there's no real reason to use it unless you're using the features it provides. It is also considerably harder to configure, as it doesn't generate mod_jk.conf files for you (not that they're hard to do, I'm just lazy icon_razz.gif ).
[/edit]
mrkanitkar
Ensim Linux Webppliance 3.1 comes with tomcat 4.03 with support for Servlet/JSP Spec 2.3/1.2 ,Aslo have mysql,postgres database drivers,tryrex on domain level.
icon_razz.gif
4web-space
Hello,
Im just testing out JSP on our boxes

Why is it that if you view domain.com/helloworld.jsp you get an empty document but if you do domain.com:8080/helloworld.jsp it displays?

Anyways of forwarding the first to the latter without having to type in the port?

Thanks

Robbie
4web-space
Ok ive found the problem so all you Plesky people out there who have got this far and have problems of only getting jsp 8080 do this

You know what im a genius!

You have to build the mod_jk yourself forget the one on the webpage you are told to download!!


Follow these instructions

1/ cd /usr/java/jakarta-tomcat-3.3.1/native/mod_jk/apache1.3
2/ pico build-unix.sh

3/ FIND APACHE_HOME=/usr/local/apache

Alter to APACHE_HOME=/usr/local/psa/apache

exit and save the script
ctrl o ctrl w

run it
sh build-unix.sh

Stop Tomcat
Stop Apache
Start Tomcat
Start Apache

And hey presto it will work


Thanks

Robbie
4web-space.com
mrkanitkar
WEBppliance 3.1 comes with Tomcat 4.0.3
with full java support.
mouse
followed your instructions to a T, including the extra RPM mentioned further down the list.. I keep getting this though..

[root@ns1 rpm]# 2002-06-28 03:20:10 - SessionIdGenerator: Opening /dev/urandom
ERROR reading /usr/java/jakarta-tomcat-3.3a/conf/server.xml
At Expected "" to terminate element starting on line 2.


it also goes on to list many lines of stuff each starting by mentioning the above issue.. any ideas?
Mouse
alex2k
Make sure you start tomcat before apache!
mouse
yes, this issue would be with apache at a dead stop.. as I said, to a T, minus the 1 or 4 spelling errors from the how-to.. Mouse
aussie
QUOTE
Originally posted by Robert C
Tomcat 3.3a installation guide [ENSIM]:

Note: This guide is only for Tomcat3.3a, and it may not work for tomcat3.2.x or tomcat4.0  

Step One: Install the java 1.3.1 SDK  

1) Download the RPM shell script for JAVA1.3.1 SDK  

http://java.sun.com/j2se/1.3/download-linux.html  

wget ftp://207.240.117.146/pub/j2sdk/1.3.1/oei...ux-i386-rpm.bin
wget ftp://ftp.java.sun.com/pub/j2sdk/1.3.1/oe...ux-i386-rpm.bin
wget ftp://128.11.158.66/pub/j2sdk/1.3.1/oeiqt...ux-i386-rpm.bin



Some of the above links are no longer in existance. Do you have a HOWTO for Tomcat 3.2 or any of the other versions?
Timb0h
I installed tomcat 3.3.1 using the original how-to from above, you just have to delete the end part of all the links to get a dir lisintg up and download the latest files instead. also remember lots of the commands in the how-to contain the dir location, so replace it to where your version of tomcat is, ie mine is in /usr/java/jakarta-tomcat-3.3.1/

with regards to starting up on boot, what you have to do is create this file :

/etc/init.d/tomcat

CODE
#!/bin/bash

#

# apache        

#

# chkconfig:

# description:  Start up the Tomcat servlet engine.



# Source function library.

. /etc/init.d/functions





RETVAL=$?

TOMCATHOME="/usr/java/jakarta-tomcat-3.3.1"



case "$1" in

start)

       if [ -f $TOMCATHOME/bin/startup.sh ];

         then

    echo $"Starting Tomcat"

           /bin/su nobody $TOMCATHOME/bin/startup.sh

       fi

;;

stop)

       if [ -f $TOMCATHOME/bin/shutdown.sh ];

         then

    echo $"Stopping Tomcat"

           /bin/su nobody $TOMCATHOME/bin/shutdown.sh

       fi

;;

*)

 echo $"Usage: $0 {start|stop}"

    exit 1

;;

esac



exit $RETVAL


REMEMBER TO EDIT THE TOMCATHOME IF YOUR DIR ISNT THE SAME AS MINE

chmod the file u just created to 755

then

cd /etc/rc5.d

ln -s ../init.d/tomcat S84tomcat


why 84? coz apache is 85 icon_smile.gif and u want tomcat to start before it!

USUAL CRAP ABOUT ME NOT BEING RESPONSIBLE IF YOU BREAK YOUR SERVER ETC ETC

note : this ain't actually tested coz i ain't restarted my server yet to find out ;P but should work in principle
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.