auto startup tomcat when linux system centos boot up

Kin Fat SZE
Kin Fat SZE used Ask the Experts™
on
Hi,
I trying to startup tomcat when linux system centos boot up and following document http://tomcat.apache.org/tomcat-6.0-doc/setup.html

it said
The file $CATALINA_HOME/bin/jsvc/native/tomcat.sh can be used as a template for starting Tomcat automatically at boot time from /etc/init.d. The file is currently setup for running Tomcat 4.1.x, so it is necessary to edit it and change the classname from BootstrapService to Bootstrap.

How to do this?

anybody help?
Thanks
Francis SZE
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Developer
Commented:
Have you ever used a text editor before? vi can be a bit of a shock to a novice (we all were one once). Or you can try sed: I've only ever got to grips with the replace command but that's all you need here. Use the line below to create newtomcat.sh, which you can then use as a template (i.e. add to rc.local in /etc/rc.d/init.d or wherever it is)

cat tomcat.sh | sed 's/BootstrapService/Bootstrap/g' >newtomcat.sh

find /etc -name rc.local

Open in new window

Hi,

I may have problem on jsvc
I found out an error at attach. could you solve it first?
[fsze88@fsze88-linux apache-tomcat-6.0.26]$ pwd
/usr/local/apache/apache-tomcat-6.0.26
[fsze88@fsze88-linux apache-tomcat-6.0.26]$ ./bin/jsvc -jvm
04/07/2010 01:31:12 3638 jsvc error: Invalid Java VM name specified
04/07/2010 01:31:12 3638 jsvc error: Cannot parse command line arguments
[fsze88@fsze88-linux apache-tomcat-6.0.26]$ ./bin/jsvc -verion
04/07/2010 01:31:21 3640 jsvc error: Invalid option -verion
04/07/2010 01:31:21 3640 jsvc error: Cannot parse command line arguments

Open in new window

Duncan RoeSoftware Developer

Commented:
I don't have jsvc. Why do you think it wants -jvm as an argument? If you wanted to find its version, I think you mis-spelled it as verion.
Try ./bin/jsvc -version
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

let said
[fsze88@fsze88-linux logs]$ ../bin/jsvc -version
04/07/2010 02:17:44 2539 jsvc error: No class specified
04/07/2010 02:17:44 2539 jsvc error: Cannot parse command line arguments

in /usr/local/apache/apache-tomcat-6.0.26/logs

04/07/2010 02:15:04 2013 jsvc.exec error: Cannot open PID file /var/run/jsvc.pid, PID is 2013
04/07/2010 02:15:04 2011 jsvc.exec error: Service exit with a return value of 255

is there any  problem of jsvc? or missed a file  /var/run/jsvc.pid? about apache web server.

Thanks

Francis SZE
I did by
chkconfig --level 2345 tomcat6 on
yum install tomcat6
 yum install tomcat6-webapps tomcat6-admin-webapps
Top Expert 2015

Commented:
It is best started from "java service wrapper" yum install wrapper / and read it's instructions on how to handle OOM condition in Tomcat

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial