[quote]In linux system. only root user can use the port small than 1024, so if you change tomcat port to 80 and start without root account, then you will see the following error: [/quote]
[quote]The solution is to use iptables to map port 80 with the default port 8080[/quote]
java.net.BindException: Permission denied <null>
[quote]The solution is to use iptables to map port 80 with the default port 8080[/quote]
#map tomcat port:8080 to port:80 , so the external host can access tomcat via both 8080 and 80
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
#let local application to access tomcat via port 80
iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 8080
#save mapping, so after linux box reboot, still have these port mapping
service iptables save
#view existed port mapping
iptables -t nat --line-numbers -n -L