美文网首页
centos 安装nginx

centos 安装nginx

作者: 天生小包 | 来源:发表于2018-09-26 17:31 被阅读0次
一、配置epel yum 源
# wget http://dl.Fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 
# rpm -ivh epel-release-latest-7.noarch.rpm
# yum install nginx -y
#  yum remove nginx  卸载

二、查看确认 是否安装

 # rpm -qa | grep nginx
image.png

三、查看 安装nginx 所生成的文件

# rpm -ql nginx 

四、启动nginx

//启动nginx
# systemctl start nginx 
//设置开机启动
# systemctl enable nginx
//查看nginx 启动状态
# systemctl status nginx
# 无法关闭 netstat -nltp
# kill ` ps -ef | grep 'nginx' | awk '{print $2}' `

在浏览器中输入 nginx 服务器的ip 地址,如果不能正常访问,关闭防火墙

 // 停止firewall
# systemctl stop firewalld.service 
// 禁止firewall开机启动
# systemctl disable firewalld.service 
// 查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
# firewall-cmd --state 

相关文章

网友评论

      本文标题:centos 安装nginx

      本文链接:https://www.haomeiwen.com/subject/jorjoftx.html