Breaking

How to Start apache tomcat server on startup in Centos,Redhat







1. First install the apache server.


                           http://rapidsolutions4u.blogspot.in/2016/09/install-apache-tomcat-on-linux-1.html

2. Go to init.d directory.


                                # cd /etc/init.d


3. Create and edit "tomcat" file.


                                # vim tomcat


#!/bin/bash  
# description: Tomcat Start Stop Restart  
# processname: tomcat  
# chkconfig: 234 20 80  
JAVA_HOME=jdk path 
export JAVA_HOME  
PATH=$JAVA_HOME/bin:$PATH  
export PATH  
CATALINA_HOME=apache path  
 
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


4. Save the file.

5. Set permission to created file.

                               #  chmod 755 tomcat

6. Add on startup


                               # chkconfig --add tomcat
                               # chkconfig --level 35 tomcat on


7. Start tomcat service.



                             /etc/init.d/tomcat on


8. Similarly stop and restart tomcat service.



2 comments:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete

Powered by Blogger.