website Download
1. Direct download. tar.gz installation package, Address: http://tomcat.apache.org/download-70.cgi
2. Use the wget command to download (recommended).
Wget-c http://mirrors.hust.edu.cn/apache/tomcat/tomcat-7/v7.0.70/bin/apache-tomcat-7.0.70.tar.gz
Decompression
remain the direct command:
TAR-ZXVF apache-tomcat-7.0.70.tar.gz
Start
Enter the unpacked apache-tomcat-7.0.70-bin directory and execute the command:
./startup.sh
After startup, open the browser, enter your CentOS address + port 8080 (the default port), you can see this page, you have installed and started to complete.
If you are using Xshell connection CentOS, this time may you although the installation succeeds, you enter the address and did not see above the picture, said cannot visit this website what, this time, please check CentOS Firewall is closed, also can add open 8080 ports in the iptables. This is no longer a concrete operation.
Firewall-cmd--zone=public--add-port=80/tcp--permanent
Success indicates added success
Command meaning:--zone #作用域
--ADD-PORT=80/TCP #添加端口, Format: Port/Communication protocol
--permanent #永久生效, failure after reboot without this parameter
Reboot firewall
Systemctl Restart Firewalld.service
Stop
Enter the directory and execute the command.
Here, all operations to install, start, and stop Tomcat under the CentOS system are complete.