Requirement: JDK 1.6 or later
curl http://apache.mirrors.tds.net/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.tar.gz | tar xvz
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
<h5>where JAVA_HOME is your path</h5>
```bash
[root@~]# echo $JAVA_HOME
/usr/java/jdk1.7.0_25
```bash
[root@init.d]# chmod 755 tomcat
[root@init.d]# chkconfig --add tomcat
[root@init.d]# chkconfig --level 234 tomcat on
```
```bash
[root@init.d]# chkconfig --list tomcat
tomcat 0:off 1:off 2:on 3:on 4:on 5:off 6:off
```
```bash
[root@init.d]# service tomcat start
[root@init.d]# service tomcat stop
[root@init.d]# service tomcat restart
```