问题
I am running Ruby on Rails on my Mac Book Pro on El Capitan and I would like to access my webpage from other computers.
How can I enable the port 3000 in the firewall?
回答1:
Firstly, you can disable the firewall by following this path:
System Preferences > Security > Firewall
and you can see all list on the terminal by this code:
sudo ipfw list
Secondly, you can add specific port with two ways:
Command Terminal
[1-Step]: type on terminal
sudo vim /etc/pf.conf
[2-Step]: Add this line of end of file.
pass in proto tcp from any to any port 3000
[3-Step]: Test and reboot.
sudo pfctl -vnf /etc/pf.conf
reboot
Also, this is helpful blog post about your problem
- WaterRoof (GUI)
Good works!
来源:https://stackoverflow.com/questions/35683979/how-to-open-a-port-in-el-capitan