It's not a secret anymore!
The moose likes Tomcat and the fly likes how to confgure Tomcat4.0? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how to confgure Tomcat4.0?" Watch "how to confgure Tomcat4.0?" New topic

how to confgure Tomcat4.0?

Tamana Joshi

Joined: May 23, 2005
Posts: 21
hi all,
plz tell me how to configure tomcat 4.0?
plz tell all the steps!
in advance
Arul Jose
Ranch Hand

Joined: Jan 14, 2005
Posts: 131
Installing Apache Jakarta Tomcat.

I have written it for tomcat 5.0.28 in linux. Please get this, its much better. I think the same will apply for 4 also.

Unzip tomcat bundle in a folder. you will get jakarta-tomcat-xxxx folder which is the main tomcat folder, often refered to as $CATALINA_HOME folder.

Go to CATALINA_HOME/bin, take the file and add the following two lines in the beginning

JAVA_HOME=/usr/local/j2sdk1.4.2_03/ --comment-- This is the java installation folder (j2sdk...)
BASEDIR=/home/aruljose/appl/tomcat/jakarta-tomcat-5.0.28/ --comment-- This is the $CATALINA folder

Go to the user home directory, take the file .bash_profile(a hidden file) and the add the java folder (j2sdk...) to the path. The next line has a sample.

(I have added to the already existing PATH variable by including $PATH)

Then go to bin of $CATALINA and execute you will see the following four lines.
Using CATALINA_BASE: /home/aruljose/appl/tomcat/jakarta-tomcat-5.0.28
Using CATALINA_HOME: /home/aruljose/appl/tomcat/jakarta-tomcat-5.0.28
Using CATALINA_TMPDIR: /home/aruljose/appl/tomcat/jakarta-tomcat-5.0.28/temp
Using JAVA_HOME: /usr/local/j2sdk1.4.2_03/

Once you get these four lines, the web-server is started.

Open the browser and type http://localhost:8080/

You will see the tomcat page with various documentation details.

Now, how to run a jsp application with Tomcat.
In $CATALINA_HOME/webapps you will see some folders, they are the applications deployed in tomcat. So to deploy an application create a folder, say 'applicationFolder' inside webapps. then create a WEB-INF directory inside the newfolder which is a must. inside $CATALINA/webapps/applicationFolder, save your jsp file say hello.jsp.

Execute the files and (found in $CATALINA_HOME/bin) subsequently to restart the web-server.

Open the browser and call your file this way http://localhost:8080/newfolder/hello.jsp

You will see the result of your jsp file execution.

Next, setting classpath and path for Java.
This could be done inside .bashrc.

PATH variable should be pointing to the folder that contains all the java executables which compile and run your program.

for example /usr/java/j2sdkxxx/bin/

CLASSPATH variable should be pointing to the folders which contain the *.class files.

see a sample .bashrc file

export PATH=:/usr/kerberos/bin/:/usr/local/bin/:/usr/java/j2sdk1.4.0_01/bin/:/usr/bin/:/bin/:/usr/X11R6/bin/
export JAVA_HOME=/usr/java/j2sdk1.4.0_01/
export CLASSPATH=/usr/java/j2sdk1.4.0_01/

Same procedure is followed to add classpath to the new directories which contain the java class files.

Once this is done, the java files can be compiled and run from anywhere.

About compiling a java file and placing it in another destination directory
<>You can use the following command

java -d destination-dir *.java (to compile all the java files)

for example,
javac -d /home/aruljose/classes

The path following -d is the destination directory.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Did you write that or copy and paste?

Anyhoo, I'm moving this post to the Apache/Tomcat forum.

Consider Paul's rocket mass heater.
subject: how to confgure Tomcat4.0?
It's not a secret anymore!