MAC OS is essentially a UNIX system, and UNIX systems are mostly non-root users that are not able to use a common port less than 1024 by default. At this time if you need to use 80 ports in your development, such as Tomcat, for example, Vitualbox An HTTP service has been built and you need to do some system port forwarding if you want to access it directly from the browser's localhost (without the ": Port").
MAC OS 10.10 on pfctl can do this thing, for details, see
1. Create File:
sudo vim/etc/pf.anchors/eclipse.tomcat.forwarding
File contents:
127.0. 0.1 the 127.0. 0.1 8080 127.0. 0.1 443 127.0. 0.1 8443
2. Create file:
sudo vim/etc/pf-tomcat.conf
File contents:
" forwarding " Load " forwarding " " /etc/pf.anchors/eclipse.tomcat.forwarding "
3. Start
sudo pfctl-ef/etc/pf-tomcat.conf
Execution results
sudo pfctl-ef/etc/pf- tomcat.conf -f option, could result in flushing of rulespresent in the main ruleset added by the system at startup. See/etc/pf.conf for further details. No ALTQ support in KERNELALTQ related functions DISABLEDPF enabled
Assuming your project http://localhost/myDemo.html this time to access your Web project, you will find that http://localhost/myDemo.html this does not require a 8080 port to access, plus/HTTP Localhost:8080/mydemo.html can't access it. 4. Close
sudo pfctl-d
Execution results
sudo pfctl- d In KERNELALTQ related functions DISABLEDPF disabled
When you visit your Web project, you will find that http://localhost/myDemo.html cannot access it, plus http://localhost:8080/myDemo.html can access it. or close all
Pfctl-f all-f/etc/pf.conf
8080-port to 80-port forwarding under Mac