0

I'm new to Linux but having spent a whole day I Installed Java and Tomcat. My goal is to host an App with this Linux box. I know it all works fine from my windows based machine, but it is my laptop so I'm planning to use the Linux Box as my dedicated server.

I am following this tutorial . From this tutorial I have executed the following command :

cd /etc/init.d 
vi tomcat 
#!/bin/bash  
# description: Tomcat Start Stop Restart  
# processname: tomcat  
# chkconfig: 234 20 80  
JAVA_HOME=/usr/java/jdk1.7.0_05  
export JAVA_HOME  
PATH=$JAVA_HOME/bin:$PATH  
export PATH  
CATALINA_HOME=/usr/share/apache-tomcat-7.0.29  

case $1 in  
start)  
sh $CATALINA_HOME/bin/startup.sh  
;;   
stop)     
sh $CATALINA_HOME/bin/shutdown.sh  
;;   
restart)  
sh $CATALINA_HOME/bin/shutdown.sh  
sh $CATALINA_HOME/bin/startup.sh  
;;   
esac      
exit 0  
chmod 755 tomcat
chkconfig --add tomcat 
chkconfig --level 234 tomcat on 
chkconfig --list tomcat 
service tomcat start  

After this command , tomcat is started at port 8082 . But when I restart pc , the tomcat is not started with boot of PC .

How can I do this ?

1

Run the following command to set the service to start automatically:

chkconfig tomcat on
  • Note: Forwarding request to 'systemctl enable tomcat.service'. Failed to issue method call: Bad message – Sagor Feb 20 '17 at 12:10
  • Why do you install it like that and not through yum? check out this article: digitalocean.com/community/tutorials/… – Itai Ganot Feb 20 '17 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.