1. 准备tomcat账号
- 本着最小权限原则,新建账号来安装tomcat。
- 命令:useradd , passwd
2. 配置防火墙
2.1. tomcat.xml
在/etc/firewalld/services/目录下新建一个名为tomcat.xml的文件,文件操作参考:。
Tomcat Webserver this is myweb
2.2. 把服务加入防火墙
systemctl start firewalld systemctl enable firewalld firewall-cmd --reload firewall-cmd --add-service=tomcat firewall-cmd --permanent --add-service=tomcat
2.3. 端口转发
非root用户不能侦听低于1023的端口,把发往80的包发给8080
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=8080
3. 安装JDK
3. 安装tomcat