CentOS 7 configuration Tomcat boot up

Source: Internet
Author: User

1. Tomcat needs to add a PID file
Under the Tomca/bin directory, add the setenv.sh configuration, which is called when the catalina.sh is started and configures the Java memory parameters.

#add tomcat Pidcatalina_pid="$CATALINA _base/tomcat.pid"#add java optsjava_ OPTS="-server-xx:permsize=256m-xx:maxpermsize=1024m-xms512m-xmx1024m-xx:maxnewsize=256m "

2. Increase Tomcat.service

 [unit]description  =tomcatafter  = Syslog.target network.target remote-fs.target nss-lookup.target[service]type  = forkingpidfile  =/usr/local/tomcat/apache-tomcat- 8.5 . 8 /tomcat.pidexecstart  =/usr/local/ Tomcat/apache-tomcat-8.5 . 8 /bin/startup. sh  execstop  =/bin/kill - s QUIT $MAINPIDExecReload  =/bin/kill -< Span style= "COLOR: #000000" >s HUP $MAINPIDPrivateTmp  =true  [install]wantedby  =multi-user.target 

3. Using Tomcat.service

Configure boot-up

Systemctl Enable Tomcat
Start Tomcat
Systemctl Start Tomcat
Stop Tomcat
Systemctl Stop Tomcat
Restart Tomcat
Systemctl Restart Tomcat

Because the PID is configured, the Tomcat root directory generates the Tomcat.pid file at boot time and is removed after it is stopped.


At the same time when Tomcat starts, executing start does not start two Tomcat, ensuring that only one Tomcat service is always running.
Multiple tomcat can be configured in multiple directories, with no impact.

CentOS 7 configuration Tomcat boot up

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.