• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

how to confgure Tomcat4.0?

Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
plz tell me how to configure tomcat 4.0?
plz tell all the steps!
in advance
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 setclasspath.sh 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 startup.sh 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 shutdown.sh and startup.sh (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 NameHandler.java

The path following -d is the destination directory.
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you write that or copy and paste?

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

pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic