How to change the port of Tomcat from 8080 to 80?

后端 未结 13 768
野的像风
野的像风 2020-11-22 17:22

I want to execute my web app as http://localhost.

13条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 17:57

    Running the command below worked with. Tried changing server.xml and the conf file but both didn't work.

    /sbin/iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
    
    /sbin/iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
    
    /sbin/iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
    

提交回复
热议问题