Set up Linux boot autostart tomcat

Source: Internet
Author: User
I. Common methods

Tomcat安装目录下的bin目录有两个脚本分别用来启动和停止Tomcat,分别是startup.sh, shutdown.sh,你可以用这两个脚本来手工启动和停止Tomcat服务并进行安装后的测试。我们最简单的方法就是通过startup.sh来自动启动Tomcat,编辑/etc/rc.d/rc.local 增加内容(假设JDK目录是/usr/jdk,Tomcat目录是/apache/tomcat)export JDK_HOME=/usr/jdkexport JAVA_HOME=/usr/jdk/apache/tomcat/bin/startup.sh这样在系统重启后就可以自动启动Tomcat

Two. A complex and professional approach

前面介绍的应该是最简单的让Tomcat自动启动的方法了,但是它有两个不足1. 无法指定启动Tomcat服务的用户,会导致Tomcat已超级用户运行,存在重大的安全隐患2. 系统关闭的时候无法自动停止Tomcat服务

Set up Linux boot autostart tomcat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.