跳到主内容

linux怎么打开80端口

· 1分钟阅读

本文介绍如何在 linux 环境下打开 80 端口

操作步骤

  1. 首先打开 linux 的终端,在里面输入指令
vi /etc/sysconfig/iptables

打开iptables的配置文件,添加下面配置

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
  1. 重启 iptables 服务,在终端输入
service iptables restart