关于linux:创建服务tomcat-启动和关闭

Create service tomcat - Start and Shutdown

我安装了apache tomcat,但是要启动服务,我必须转到路径$ HOME / apache-tomcat-8.0.28 / bin并运行脚本./startup.sh来启动,而./shutdown.sh来关闭。 我该怎么做

service tomcat start

service tomcat stop

还是无需在Ubuntu上转到tomcat的路径的另一种方法?


/etc/init.d/tomcat stop
/etc/init.d/tomcat start