First, statement:
This article uses the operating system version: Centos 7 Linux system
Version Source: Centos-7-x86_64-dvd-1708.iso
Official website: Http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso
Installation package Selection: Minimum installation package (with JDK installed and vim function)
Ii. preparations for the installation of Tomcat 7
Download the Tomcat installation package from the Apache official website (we recommend using the installation file in the form of a tar package)
Official website:http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.82/bin/apache-tomcat-7.0.82.tar.gz
2.1 Upload the Tomcat installation file to the Linux system via FTP software
The niche is placed under the/var/ftp/pub folder.
2.2 Unzip the file and cut to/directory
Unzip file:tar-zxvf apache-tomcat-7.0.82.tar.gz
Move to the root directory:mv apache-tomcat-7.0.82.tar.gz/
Renaming files:mv apache-tomcat-7.0.82.tar.gz./TOMCAT7
Third, start Tomcat
See if the. sh file under the /tomcat7/bin/ directory is executable
Use the LL command to view file usage rights
If the file is not available, use the command:
chmod 755./*.sh
Modify all the. sh files in the current directory to make them executable files
Run Tomcat:./startup.sh
Close tomcat: ./shutdowm.sh
Four, firewall configuration
Open 8080 Ports:
Firewall-cmd--zone=public--add-port=8080/tcp--permanent
Restarting the firewall
Firewall-cmd--reload
V. Setting up tomcat boot from boot
4.1 Edit Tomcat.service Profile:vim/lib/systemd/system/tomcat.service
[Unit]description=tomcatafter=Network.target[service]type=oneshot# Note that the tomcat path write is modified correctly Execstart=/tomcat7/bin/startup. SH execstop=/tomcat7/bin/shutdown. SH execreload=/bin/kill -s HUP $MAINPIDRemainAfterExit=Yes[install]wantedby= Multi-user.target
4.2 Start-up service: systemctl start Tomcat.service
4.3 View service Status:systemctl status Tomcat.service
4.4 Set up boot from:systemctl enable Tomcat.service
Description: No boot from boot:systemctl disable Tomcat.service
Cemtos 7 Linux Install and uninstall Tomcat 7