A simple way to configure Iptables to turn 80 ports to 8080 _linux

Source: Internet
Author: User

Tomcat is deployed under Linux, and for security we start with a non-root user, but the 80 port number cannot be accessed directly at the time of the domain binding. As we all know, under Unix, non-root users can not listen to more than 1024 of the port number, the Tomcat server can not be bound to the 80 port. So here we need to use Linux port forwarding mechanism, to the 80-port service request to go to 8080 port.

Run the command below the root account:

Iptables-t nat-a prerouting-p tcp--dport 80-j REDIRECT--to-port 8080

Note: Online friends ' commands are dport in front of them-------------usually. In addition, if the firewall reboots, the command is invalidated.

You can use the following command to save the rule to iptables:

Service Iptables Save

The above configuration iptables, the 80-port to 8080 of the simple way is to share the whole of the content of everyone, hope to give you a reference, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.