how to get Tomcat to run on startup?
Thank you to all of you who helped me get Slackware installed and running.
I just installed Apache Tomcat, and it runs fine, but I can't seem to get it to run on startup (boot up) of the machine. What else do I need to do? Just like I did successfully with MySQL when I installed it, I added the following to /etc/rc.d/rc.M (after the code which launches Apache): if [ -x /etc/rc.d/rc.tomcat ]' then . /etc/rc.d/rc.tomcat start fi Manually, I created the rc.tomcat (owned by root:root with -rwxr-xr-x permissions) and it contains: case "$1" in 'start') /apache-tomcat-5.5.17/bin/startup.sh ;; 'stop') /apache-tomcat-5.5.17/bin/shutdown.sh ;; 'restart') /apache-tomcat-5.5.17/bin/shutdown.sh sleep 3 /apache-tomcat-5.5.17/bin/startup.sh ;; *) echo "usage $0 start|stop|restart" esac Now, if I login as root and type "/etc/rc.d/rc.tomcat start" from the command line, Tomcat starts just fine. So I guess my script is okay. If I copy/paste the code piece inside rc.M into a temporary file and execute it, Tomcat starts fine. So why doesn't Tomcat startup automatically when I first boot the machine? What else do I need to do? Is there a log file somewhere that I can look at? Nothing in /apache-tomcat-5.5.17/logs seems to be helpful. |
typo
...don't worry, my script really does have the ; instead of the '
if [ -x /etc/rc.d/rc.tomcat ]; then |
You should use:
Code:
export JAVA_HOME=/path/to/java Regards |
fixed!
That did it!
I had the export statements in /etc/profile, but I guess that must be read after /etc/rc.d/rc.M, because moving the export statements to rc.M just prior to calling /etc/rc.d/rc.tomcat did the trick. Maybe this is basic stuff to you folks, but I don't know how I would hae figured it out as a newbie without you. Thanks! |
Hi,
I have installed Tomcat (following Marty Hall's excellent guide) and everything works fine. My question is in relation to the startup.sh and catalina.sh files. Why do I need to be root user to start Tomcat? Is there a way to allow the local user to do this? The only thing I've spotted is that the file tomcat-users.xml is root:root - all else is localuser:users. So my problem is that I have to su - root each time I need to control the server. Regards, Lee. |
I have a tomcat user and tomcat group and I just did chown -R tomcat:tomcat /usr/local/apache-tomcat-5.5.17 - then in my start up script I have:
Code:
/bin/su - tomcat -c /usr/local/bin/start-tomcat.sh |
Thanks for this Steve.
I had created symbolic links to the startup/shutdown scripts and placed them in my home directory. I also had chgrp/chown the tomcat installation directory in favour of my local user - so I thought that would work. Does your tomcat user have (root like) higher privileges than a default user? I must admit that I'm not too familiar with the su options and I guess I can substitute root for your tomcat on my machine (not recommended I know). Regards, Lee. |
My tomcat user is a regular user, but for other users in the tomcat group I had to run the following so they could write to the Tomcat directories:
Code:
find /usr/local/apache-tomcat-5.5.17 -type d -exec chmod -c g+ws {} \; |
tomcat startup script
Hi all,
I got which i wrote for my tomcat version 5.0.27 using jsdk 1.4.2 to startup in /etc/init.d but i have some problem with it. Is there any kind soul who can me here. thanks amillion in advance. Code:
#!/bin/bash |
All times are GMT -5. The time now is 08:01 AM. |