NGINX 从yum安装到启动

作者: 清醒的cola | 来源:发表于2016-12-27 22:04 被阅读114次

开始
在 yum.repos.d 建一个 nginx.repo 文件

cd /etc/yum.repos.d/
vim nginx.repo

填入下列内容

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

安装

yum install nginx -y

启动

/etc/init.d/nginx start

如果没有启动
检查端口占用

netstat -ntlp

查下防火墙(开放22 80端口)

iptables -L -N

几个重要signal

  • nginx -s stop — fast shutdown
  • nginx -s quit — graceful shutdown
  • nginx -s reload — reloading the configuration file
  • nginx -s reopen — reopening the log files

相关文章

网友评论

    本文标题:NGINX 从yum安装到启动

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