Make autoservice for Tomcat


--------------------------------------------------------------------------------
Step 1
--------------------------------------------------------------------------------

Create file in this location /etc/init.d/tomcat2 with following instructions and past below lines...

#nano /etc/init.d/tomcat2


#!/bin/bash

# description: Tomcat Start Stop Restart

# processname: tomcat

# chkconfig: 234 20 80

#Should be your java path location....

JAVA_HOME=/usr/lib/jvm/jre-openjdk

export JAVA_HOME

PATH=$JAVA_HOME/bin:$PATH

export PATH

#Should be your tomcat location

CATALINA_HOME=/opt/tomcat2
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

Popular posts from this blog

Setup MySQL on Ubuntu Droplet getting error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Remote Desktop Sharing Dconf Tool in Linux (Ubuntu 14.04)

Configure Telnet & SSH on Router for Remote access.