Linux system: invalid tomcat80 port mapping to 8080

1. For example, I have a website deployed to the server: (centos)

according to the saying on the Internet:
1. Released a ROOT.war to tomcat, via www. The domain name .com: 8080 goes directly to the home page of the website.

2. But I want to be direct: www. Domain name .com access, that is, no port number is added. Because I don"t want to change port 8080 of apache to 80, because I don"t know if port 80 is needed elsewhere in the server

3. Checked the Internet: discovery method:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
service iptables save

No error, but no change, www. The domain name .com still cannot access the website, while www. The domain name .com: 8080 can only be accessed. I don"t know what went wrong. I came to codeshelper for help for the first time.

Mar.17,2021

from the browser side, use wireshark to grab packets to check the reason why it cannot be accessed. It is very likely that the firewall's TCP port 80 is not open.


is there any contradiction in your idea? you don't want to modify 8080 to 80, but map port 80 to 8080. If port 80 is really used elsewhere, isn't it directly transferred to 8080?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea5b6b-1d7a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea5b6b-1d7a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?