Mac OS X requires root privileges to bind port 80, but if you start eclipse or Tomcat with root, the various files created by the startup are root and cannot be deleted by ordinary users.
To do this, we can do the network layer port forwarding through the pfctl, so that the connection to the native 80 port of the request, are forwarded to 9090 port; (Note that Mac OS uses 80 ports for network file sharing, to shut down first)
Modify/etc/pf.conf, use sudo vim/etc/pf.conf
Pf.conf are strong in order, so pay attention to the order in which the content is added
rdr-anchor "com.apple/*"
RDR on Lo0 inet Proto TCP from all to 127.0.0.1 port, 127.0.0.1 Port 9090
Add RDR on Lo0 inet Proto TCP from all to 127.0.0.1 port, 127.0.0.1 port 9090 to pf.conf file Rdr-anchor "com.apple/*" this After the line.
Lo0 through ifconfig see oneself that device binds is 127.0.0.1, Lo0 is the name of this network device. After modifying the pf.conf, execute the command for port forwarding to take effect.
sudo pfctl -d
sudo pfctl-f/etc/pf.conf
sudo pfctl-e
In Tomcat configuration, set the boot port to 9090
All right, then. Only normal permissions are required to start Tomcat on port 9090, and access the local app directly to port 80.
Concern
Bind 80 Ports under MAC OS X