How to create daemon service for tomcat in cPanel server

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to create daemon service for tomcat in cPanel server

    How to create daemon service for tomcat in cPanel server

    Ans:

    [email protected] [] vi /etc/rc.d/init.d/tomcat

    Add the following code

    ====================================

    Code:
    [COLOR="Purple"]
    #!/bin/sh
    
    JAVA_HOME=/usr/local/jdk; export JAVA_HOME
    
    TOMCAT_HOME=/usr/local/jakarta/tomcat; export TOMCAT_HOME
    
    $TOMCAT_HOME/bin/catalina.sh $*
    
    [/COLOR]
    ====================================
    Then

    [email protected] [] chmod 755 /etc/rc.d/init.d/tomcat

    Now you can able to start/stop tomcat by using commands

    To start Tomcat :

    [email protected] [] /etc/init.d/tomcat start

    To stop Tomcat :

    Please use this command 2-3 times to stop the tomcat service on the server.

    [email protected] [] /etc/init.d/tomcat stop

    Done
Working...
X