PDA

View Full Version : Automating starting/stopping Tomcat



B.Kline
06-02-2003, 06:22 PM
Assuming you've installed the standard RPM from Apache you should find a directory /etc/tomcat4. In this directory is the configuration file tomcat4.conf -- you can specify the what you need to there. Alternately, you can create a quick script in /etc/profile.d called java.sh and specify the environmentals there like shown. Finally, use service start tomcat4 and service stop tomcat4 to start end end respectively the tomcat server. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae6c5c7/0')

B.Kline
06-03-2003, 03:32 AM
Assuming you've installed the standard RPM from Apache you should find a directory /etc/tomcat4. In this directory is the configuration file tomcat4.conf -- you can specify the what you need to there. Alternately, you can create a quick script in /etc/profile.d called java.sh and specify the environmentals there like shown. Finally, use service start tomcat4 and service stop tomcat4 to start end end respectively the tomcat server. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae6c5c7/1')

tony@negia.net
06-03-2003, 03:55 AM
I'm confused on a couple of points. When you say "Assuming you've installed the standard RPM from Apache", are you referring the Apache web server or Tomcat? I've got Tomcat setup to run standalone so I assume this is why I don't have a /etc/tomcat4 directory and any service scripts. I added the java.sh script to profile.d and called the /opt/tomcat/bin/startup.sh from cron and got the same result. What am I missing (other than Linux admin skills)?

tony@negia.net
06-03-2003, 07:07 AM
I've got a Redhat Linux (7.3) box running Tomcat 4 standalone. I'm trying to setup some scripts to coordinate startup/shutdown with our AS/400's IPL. I setup two scripts to run as cron jobs to shutdown tomcat before the IPL and restart after, but they keep failing because they cannot find the JAVA_HOME environment variable. I setup the environment variables in the .bashrc, and in frustration I added them to /etc/profile with the same result. The scripts work fine from the command line, but I assume thery are failing because cron doesn't read .bashrc or profle. Is there any other place I set environment variable so they'll be visible system wide(without reading .bashrc or profile)? Is it possible to drop a script in the init.d directory to start the server when the machine comes up? Thanks Tony

B.Kline
06-03-2003, 07:07 AM
That's what I get for writing a reply while sleepy! Once I reread what I posted I could see your confusion. Rather than drag this out via this forum, how about contacting me at blkline@attglobal.net so that I can get your e-mail address. I'll shoot you back my phone number and I can talk you through this without the delays of posting.