Port 80 bound to Mac OS X, macos

Source: Internet
Author: User

Port 80 bound to Mac OS X, macos

Mac OS X requires the ROOT permission to bind port 80. However, if you use the root permission to start eclipse or tomcat, all types of files created during startup are root and cannot be deleted by common users.

Therefore, we can use pfctl for network-layer port forwarding so that requests connected to port 80 on the local machine are forwarded to port 9090. (Note that Mac OS will use port 80 for network file sharing, close it first)

Modify/etc/pf. conf and use sudo vim/etc/pf. conf
Pf. conf is highly ordered, so pay attention to the order of added content.

rdr-anchor "com.apple/*"

Rdr on lo0 inet proto tcp from any to 127.0.0.1 port 80-> fig port 9090
Add the rdr on lo0 inet proto tcp from any to 127.0.0.1 port 80-> 127.0.0.1 port 9090 to the end of the rdr-anchor "com. apple/*" line in the pf. conf file.

Lo0 uses ifconfig to check that the device is bound to 127.0.0.1, and lo0 is the name of the network device. Modify pf. conf and execute the command to make port forwarding take effect.

sudo pfctl -d

Sudo pfctl-f/etc/pf. conf
Sudo pfctl-e
In tomcat configuration, set the Start port to 9090.

In this case, you only need the normal permission to start tomcat on port 9090 and access port 80 directly when accessing the local application.

Follow

In Mac OS X 107 lion, how does one make the program pass through the port?

Check whether the port is occupied by other programs.
 
Download Mac OS X 104

Use bt, which is available on the prospective forum.
I have never tried it on thunder, but it is estimated that it is not good ....
Do not release version 10.3. Otherwise, many of your hardware drivers will not be installed.
Go to 10.4.6, 7, or 8. The current driver can be used here.
However, you 'd better check whether your hardware has a cracked mac driver.

Related Article

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.