3

correct/safe iptables rules for redirecting port 80 to 8080

view full story
linux-howto

http://www.linuxquestions.org – I am setting up tomcat server on my Centos 5.5 machine. I've been advised to run tomcat on 8080 as non root user and redirect traffic to it from port 80. I searched and found the following iptables commands for this:# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT -to-ports 8080 # iptables -I INPUT -p tcp --dport 8080 -j ACCEPTI have a doubt: Tomcat is not accessible via port 80 without the second command. But the second command opens 8080 and makes it accessible over the internet (tomcat is accesible via both: www.<website>.com and (HowTos)