LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-30-2003, 09:24 AM   #1
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Rep: Reputation: 15
Unhappy Tomcat not purring yet


Just built a RH8 box, Apache is running on 80 just fine, dl and installed Tomcat 4.1.24 from RPM and it installed just fine.

Get message: Connection was refused when attempting to access {host:8080}

Upon reboot, I see the Tomcat4 startup status as [ OK ]

I've read through almost all other threads on this board and I don't see a 'startup.sh' anywhere. I assume Catalina is using the new tomcat4 startup file.

Any ideas? Also, how can I check to see which ports are allowed?

Thanks!
Neb
 
Old 04-30-2003, 09:54 AM   #2
shadowbird
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15
Tomcat on Redhat (using RPM)

I just went through a head-banging episode getting Tomcat to run. Hopefully I can be of assistance.

If you're using the Tomcat RPM, then there isn't a startup.sh script. There will be a K##tomcat4 file in your /etc/rc3.d directory which can be run. It, in turn, calls /usr/bin/dtomcat4.

In order I would do the following:

1. Check if tomcat is even starting. Do a ps -ax | grep tomcat command to see if it is showing up in the process list. If it isn't, go to step 2. If it is, wait a minute or two and do the same command again to see if it is exiting on its own. If it is, go to step 2. If it isn't, try to browse to it.

2. Check the log file in /var/log/tomcat4 to see if there's any errors. If not, then check the server.xml file to see which ports it is coming up on. You can also use netstat so see what ports are in use.

3. If there are no errors, check /var/webapps to see if there's any applications installed - for some reason the RPMs don't seem to include the standard management applications that used to come with Tomcat.

4. If all else fails, I found that I had a bad Java installation. Reinstalling Java fixed my Tomcat installation.
 
Old 04-30-2003, 02:12 PM   #3
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
Well, I did have some errors. It appears I don't have Java loaded at all.

I'm downloading now, will install, and let you know what I find.

Thanks!
Neb
 
Old 04-30-2003, 03:06 PM   #4
shadowbird
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15
I hate it when I do that!
 
Old 04-30-2003, 03:34 PM   #5
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
Reinstalled J2RE, but I don't think that's even running. How do you tell if Java is working ok?

When I try to restart Tomcat from the Services GUI window, I get the following error:
---------------------------------------
tomcat4 failed. The error was: Stopping tomcat4: which: no java in (/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin)
dirname: Found JAVA_HOME: /..
too few arguments
Try `dirname --help' for more information.
Please complete your /etc/tomcat4/tomcat4.conf so we won't have to look for it next time
Using CATALINA_BASE: /var/tomcat4
Using CATALINA_HOME: /var/tomcat4
Using CATALINA_TMPDIR: /var/tomcat4/temp
Using JAVA_HOME: /..
/usr/bin/dtomcat4: line 279: /../bin/java: No such file or directory
/usr/bin/dtomcat4: line 279: exec: /../bin/java: cannot execute: No such file or directory
[FAILED]
Starting tomcat4: process already running
-----------------------------------------------

Also, here's the lines in the file:/var/log/tomcat4/catalina.out:

/usr/bin/dtomcat4: line 263: /../bin/java: No such file or directory
/usr/bin/dtomcat4: line 263: /../bin/java: No such file or directory
/usr/bin/dtomcat4: line 263: /../bin/java: No such file or directory

the /usr/bin/dtomcat4 file shows the javadir to be /usr/share/java, but there's only ONE file in that folder; it's called "libgcj-3.2.jar"

Anything else???
 
Old 04-30-2003, 03:49 PM   #6
shadowbird
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15
Ack! You need the J2SDK not the J2RE - Tomcat needs the java compiler and a few other utilities that are not in the runtime environment-only ("RE") installation.
 
Old 04-30-2003, 03:53 PM   #7
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
Doh!! Ok, how do I un-install the J2RE, or do I need to?
 
Old 04-30-2003, 04:00 PM   #8
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
For some stupid reason, I can't seem to correctly identify which J* I need. Is the J2EE-SDK, the J2SE-SDK, or the J2ME-SDK.

They don't make it very easy for the newbies do they?
 
Old 04-30-2003, 04:04 PM   #9
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
Gee, it's right there under the SDK column.
 
Old 04-30-2003, 04:06 PM   #10
shadowbird
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15
Okay, to remove the old JRE (although you don't have to), just delete the directory (rm -rf the_directory)

You will want the J2SE SDK

Note that the J2SDK contains the J2RE within it. So, if you don't remove the old JRE it won't hurt anything, but it will not be used and will lie around using up disk space.

Note that you may have to change your JAVA_HOME setting as well (that's important! ::grin:
 
Old 04-30-2003, 04:12 PM   #11
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
And since I'm obviously just getting started, how or where do you set/change the JAVA_HOME setting?
 
Old 04-30-2003, 04:25 PM   #12
shadowbird
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15
Ya know, you would think I'd have put that into my message instead of making you ask for it ... Sorry 'bout that!

How do you plan on starting Tomcat? there are several ways of doing it. Note, however that upon looking back at my installation, the Tomcat scripts do a pretty good job of findind thhe Java SDK all on their own - you may not have to change anything.

However, here's the "traditional" ways to do it:

Go to your Tomcat directory (not the webapps directory!). That may be one of the following (depending on how you installed):

/usr/tomcat4
/usr/java/tomcat4
/usr/local/tomcat4
/var/tomcat4

Go into the "bin" directory and edit or create a file called "setenv.sh"

Put in the command:

export JAVA_HOME=directory_to_J2SDK

The directory to J2SDK is usually something like /usr/java/jdk, which is usually symlinked BY THE USER (i.e. YOU) to wherever the real installation directory for the JDK was. On my system, I created that link via the following command:

sudo ln -s /usr/java/j2sdk1.4.1_02 /usr/java/jdk
sudo ln -s /usr/java/j2sdk1.4.1_02 /usr/java/sdk

(note: You may not have sudo installed in which case use the following commands instead:

su
ln -s /usr/java/j2sdk1.4.1_02 /usr/java/jdk
ln -s /usr/java/j2sdk1.4.1_02 /usr/java/sdk
CTRL-D

)
 
Old 05-01-2003, 09:17 PM   #13
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
Did all that. This stuff still doesn't work. It's no wonder Linux is slow to catch up. When will someone make it so it's just click, install, work?

I'll keep tinkering, but it might be awhile at my pace.

Thank you so much for the help!!
 
Old 05-14-2003, 11:57 AM   #14
Neb
LQ Newbie
 
Registered: Apr 2003
Location: New York
Distribution: Red Hat, SuSe
Posts: 29

Original Poster
Rep: Reputation: 15
Finally got it!! I had to modify the tomcat4.conf file and override the exact location of java.

Now, my URL:8080 works just fine showing me the Tomcat screen.

Now for my next quest, to get Tomcat to interface with Apache on port 80 so that static HTML gets served by Apache and servlets get redirected to Tomcat.

Any ideas?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help regarding tomcat farhank Linux - Software 2 03-24-2008 08:00 AM
is it possible for tomcat wangjinyi Programming 3 05-24-2005 02:59 PM
Tomcat 4 simplyrahul Linux - Software 10 10-29-2004 03:31 PM
TOMCAT init script not working on startup -- tomcat 4.x / Mandrake Linux 8.0 jmartinph Mandriva 0 03-08-2004 02:31 AM
Why use Apache with Tomcat rather than just Tomcat itself? davee Linux - Software 1 08-21-2003 10:47 PM


All times are GMT -5. The time now is 10:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration