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

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

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

13条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 18:00

    I tried changing the port from 8080 to 80 in the server.xml but it didn't work for me. Then I found alternative, update the iptables which i'm sure there is an impact on performance.

    I use the following commands:

    sudo /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
    sudo /sbin/service iptables save
    

    http://www.excelsior-usa.com/articles/tomcat-amazon-ec2-advanced.html#port80

提交回复
热议问题