Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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"
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.
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:
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):
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.