Linux下yum安装Nginx
(1):使⽤yum安装nginx,安装nginx库
rpm -Uvh /packages/centos/6/noarch/RPMS/arch.rpm
(2):使⽤下⾯命令安装nginx
yum -y install nginx
linux离线安装nginx详细教程
(3):启动nginx
service nginx start  #centos6
systemctl start nginx.service  #centos7
(4):防⽕墙允许通过80端⼝
vim /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Thu Dec 28 19:47:19 2017*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [21691:949300]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
(5):重启防⽕墙
service iptables restart
(6):访问 localhost:80

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。