如何在埃尔卡皮坦打开港口 [英] How to open a port in El Capitan
问题描述
我正在El Capitan的Mac Book Pro上运行Ruby on Rails,我想从其他计算机上访问我的网页.
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.
如何在防火墙中启用端口3000?
How can I enable the port 3000 in the firewall?
推荐答案
首先,您可以按照以下路径禁用防火墙:
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]:在终端上键入
[1-Step]: type on terminal
sudo vim/etc/pf.conf
sudo vim /etc/pf.conf
[2-Step]:在文件末尾添加这一行.
[2-Step]: Add this line of end of file.
pass in proto tcp from any to any port 3000
[3步]:测试并重新启动.
[3-Step]: Test and reboot.
sudo pfctl -vnf /etc/pf.conf
reboot
此外,此对您的问题很有帮助的博客文章
Also, this is helpful blog post about your problem
- WaterRoof (GUI)
- WaterRoof (GUI)
好的作品!
这篇关于如何在埃尔卡皮坦打开港口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!