How to open a port in El Capitan

左心房为你撑大大i 提交于 2019-12-10 11:59:03

问题


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:

  1. 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

  1. WaterRoof (GUI)

Good works!



来源:https://stackoverflow.com/questions/35683979/how-to-open-a-port-in-el-capitan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!