• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Install Tomcat on Linux

 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18108
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
I used Jakarta-tomcat-4.0.1.tar.gz file to install Tomcat. Is .zip file better?
Thanks
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guy.
Later I used tar.gz file to install Tomcat.
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic