File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Install Tomcat on Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Install Tomcat on Linux" Watch "Install Tomcat on Linux" New topic
Author

Install Tomcat on Linux

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I downloaded jakarta-tomcat-4.0-yyyymmdd.zip to my Linux. How to I unzip it?
I don't have winzip on my Linux.
Should I download jakarta-tomcat-4.0.1.exe instead?
Thanks.
Bruce
[ February 04, 2002: Message edited by: Bruce Jin ]

BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
use the command:
uzip jakarta-tomcat-4.0-yyyymmdd.zip
depending on the flavor of your linux installation (redhat, mandrake...) i believe you should have a zip utility installed.
if not, you can always download the .tar or .gzip files instead.


what?
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks Greg.
I have Mandrake 8.0.
When I type uzip, it tells me command not found. Where to find/download uzip?
BTW, Can I download tomcat-4.0.1.exe instead?
Thanks.
Bruce
[ February 04, 2002: Message edited by: Bruce Jin ]
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
hi,
Be sure about your download(tomcat for linux version)
use guzip command to unzip. exe format used by windows don't work on linux.
Also browse the link given below. It will help you
http://www.linuxgazette.com/issue69/peda.html
-arun
[ February 05, 2002: Message edited by: Arun Boraiah ]

Sharing is learning
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15647
    
  15

Exe only works under Windows. The proper spelling and capitalization for the Linux unzip program is "unzip", but it is not installed by default on some systems, so you might have to download it or install from your setup CD. The RPM package name starts with "unzip" - it's not part of the "zip" package.
If you work much with Linux, though, it's not a bad idea to learn how to use tar, though. That's more the Unix way. tar archives are like zipfiles without compression, you then compress the entire tarball using gzip or bzip. Modern-day tar's even have an option for doing the compression for you, like so:
tar xvzf jakarta-tomcat-4.0.1.tar.gz.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
On tomcat (apache) site I don't see tomcat for linux version. I have the impression that window and Linux use the same zip file.
Any idea?
Thanks
Bruce
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
Originally posted by Bruce Jin:
Thanks Greg.
I have Mandrake 8.0.
When I type uzip, it tells me command not found. Where to find/download uzip?
BTW, Can I download tomcat-4.0.1.exe instead?
Thanks.
Bruce
[ February 04, 2002: Message edited by: Bruce Jin ]

OOPS!!! sorry, that was supposed to read:
unzip < filename >
i left the "n" out... i think i installed the .tar file last time i put tomcat on my linux box. however, i have since formatted and installed Redhat 7.2, so i am going to install tomcat again this weekend. i will let you know what i do.
(by the way, i formatted because of Win98... not linux!)
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I just downloaded the tar file and expanded it using gunzip and tar commands. Now I cd to tomcat/bin and issue:
$ startup or
$ startup.sh
It tells me that command not found. (but I could use ls to see the startup.sh file in the bin folder). Any ideas?
Thanks
Michael Burke
Ranch Hand

Joined: Jul 29, 2000
Posts: 103
Try executing ./startup.sh and to shutdown ./shutdown.sh from the bin directory. Linux requires the ./ to executes scripts from the current directory.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks for the response.
Seems I can use ./startup.sh in /tomcat/bin.
When it is starting I could use the top command to see a few Java threads running. When the cranking ended, all those Java processes died and I got a big core.nnnn file in my home/user folder. Strange! There is no error message in the starting process.
What's wrong?
Bruce
Michael Burke
Ranch Hand

Joined: Jul 29, 2000
Posts: 103
It sounds like tomcat is starting ok. It doesn't give a specific message that it's started just some info about the different paths it's using if I remember correctly. After you execute startup.sh don't close the terminal window (you can minimize it if you want). Check to see if you can access the tomcat default web apps at http://localhost:8080/. If you can do that you're good to go.
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
the reason you have to put ./ is because that directory is not listed in your PATH... so, if you do not want to type ./ everytime you launch tomcat, just put the full path to /tomcat/bin/ in your .bash_profile file like you did with jdk1.2/bin/
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks for the response.

This is very strange!
I start tomcat. I see the messages:

using CATALINA_HOME /var/tomcat/..
using CATALINA_BASE /var/tomcat/..
using JAVA_HOME /usr/jdk1.3
Then I see the box is cranking. Then I see from ‘top’ screen that a few java threads started. When the cranking ends, all java threads end too. Address http://localhost:8080/ shows page not found.
The strange thing is that after this I always got a big binary file named core.nnnn in the bin folder. The file is about 40 Mb in size! The nnnn is a random 4-digit number.
I tried other java programs and they compile and run OK.
Any ideas?
Bruce
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
the 40Mb file sounds strange... i will check that out this weekend. unfortunately, i am on a windows machine here at work, so i cannot try anything on linux until i get home.
the messages you get at startup are normal.
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Hi Bruce - I was just looking thru the posts on this forum.
After you installed Mandrake but before you installed the Sun JDK, did you un-install any Mandrake provided Java support???
I run RH systems, and maybe MD is different, but on a new RH system, I would un-install:
jikes
kaffe
before installing the Sun JDK. If this is not done, very bizarre results can occur.
I know MD uses 'rpm' for maintenance, so:
rpm -qa | sort
should give you a list of all packages installed.
I think you need to see if there was a Java environment that came with MD.
Regards, Guy
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks for the reply.
I don’t see jakes or kaffe installed (using rpm –qa | sort > rpmfile).
The installation of jdk1.3.1_02 was smooth. Then I set up $JAVA_HOME and $PATH and can compile and run java programs.
Installation of Tomcat was smooth too. I used .xxx.tar.gz file.
The only questionable thing I had was that I had to use root user ID to create /usr/jdk1..3 folder and /var/tomcat folder. Otherwise my user ID did not have permission to create these folders. (why?) Also I had to use root to install both jdk and tomcat. I also have to use root to start tomcat otherwise I get ‘no permission’ message. However I do not need to login as root to compile and run Java.
Thanks
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Hi and a couple of things:
1) Having to use root to do installs, and to start Tomcat is normal. There are ways to get around this requirement, but I cannot recommend them.
2) You installed a xxxxxxx-yyymmdd.zip of Tomcat. Because of the 'yyyymmdd', I think that is one of the nightly builds. They can be (and often are) notoriously unstable. I would remove that TC installation, go back to apache.org and D/L one of the stable releases.
HTH, Guy
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks.
I used Jakarta-tomcat-4.0.1.tar.gz file to install Tomcat. Is .zip file better?
Thanks
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
There should be no difference between .zip and .tar.gz files other than size. I only wanted to point out that your OP said a 'yyyymmdd' file. And those are guaranteed to be volatile.
Guy
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks Guy.
Later I used tar.gz file to install Tomcat.
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
Originally posted by Guy Allard:
I run RH systems, and maybe MD is different, but on a new RH system, I would un-install:
jikes
kaffe
before installing the Sun JDK. If this is not done, very bizarre results can occur.

I'm just starting with Linux and I'm still trying to install Java, but I noticed your post - so what do Jikes and Kaffe do? Am I going to miss them if I ditch them?
Txs
Adam


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Jikes (if it's there) and kaffe are alternate Java compilers and runtime environments.
I uninstall them because I want a pure Sun Java environment.
It is possible for them to co-exist, but always be very careful which java/javac are found in your current PATH.
Regards, Guy
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
Yes, I have got them on my system. I'm nowhere near advanced enough to require anything different from the Sun java, so I'm going to ditch them now.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Conclusion of this thread:
After learned that core.nnnn file means a crash I read Tomcat release notes again and found that Tomcat crashes on jdk 1.3 is a known problem. use this command took care of this.
ulimit -s 2048
Now my Tomcat is finally running on my little Linux!
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
thanks for posting that... it sounds like the problem i had with tomcat on a windows installation.
on windows you have to edit the .bat file by changing the "initial environment" to 2048 or higher... i thought that was a windows specific problem! if i had known it was a jdk or memory issue, i would have been able to help you a long time ago.
wow, i guess we learn something new every day.
Donald Nunn
Ranch Hand

Joined: Nov 11, 2000
Posts: 200
Hello, Bruce. This is what I did to install Tomcat on SuSe Linux 7.3 Professional. There may be other ways, however, so far it seems to have worked. The steps are as follows:
1. Download jakarta-tomcat-4.0.2.tar.gz to the
directory of your choosing.
2. unzip using the gunzip utility:
gunzip jakarta-tomcat-4.0.2.tar.gz
tar -xvf jakarta-tomcat-4.0.2.tar

3. x - (for extract) unpack to archive
v - (for verbose) shows all files on screen while packing.
f - (for files) allows you to choose a name for the archive file. This option must always be specified last, that is,
before the name to be given to the
archive.
4. Then move the jakarta directory to the
desired location.
5. To start Tomcat:
TOMCAT_HOME/bin/startup.sh
To shutdown Tomcat:
TOMCAT_HOME/bin/shutdown.sh
6. You may need to specifiy ./ before the
startup and shutdown commands.
By no means am I an expert yet, however, If there's a cleaner way then I'm all ears.
Regards,


<b>Donald Nunn</b><br />Sun Certified Programmer for the Java 2 Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Install Tomcat on Linux
 
Similar Threads
tomcat and linux
Can I run Tomcat on Linux?
configuration of tomcat for jsp
Linux Tomcat: java.net.BindException: Permission denied:80
How to auto start a process when Linux starts or reboot?