Linux CENTOS7 tomcat8 configured as a service startup

Source: Internet
Author: User

1. Tomact Decompression to/usr/local/tomcat

2.vim/usr/local/tomcat/bin/catalina.sh

In OS specific support. Plus (note the Java installation directory)

java_home=/usr/java/jdk1.8.0_161
Jre_home= $JAVA _home/jre

3. Configuring the Tomcat service file

Vi/usr/lib/systemd/system/tomcat.service

Input:

[Unit]
Description=tomcat
After=syslog.target Network.target Remote-fs.target Nss-lookup.target

[Service]
Type=oneshot
execstart=/usr/local/tomcat/bin/startup.sh
execstop=/usr/local/tomcat/bin/shutdown.sh
Execreload=/bin/kill-s HUP $MAINPID
Remainafterexit=yes

[Install]
Wantedby=multi-user.target

4. Allow boot start

Systemctl Enable Tomcat

5. Start, view status, restart, turn off Tomcat

Systemctl Start Tomcat.service

Systemctl Status Tomcat.service

Systemctl Restart Tomcat.service

Systemctl Stop Tomcat.service

Linux CENTOS7 tomcat8 configured as a service startup

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.