nginx

本文指导如何通过脚本安装yum包、配置Nginx稳定和主线仓库,演示了启动、信号控制和配置文件路径。重点讲解了如何使用`systemctl`进行管理和控制nginx的不同信号操作。

install:

 注意脚本里$的转义

sudo yum install yum-utils

touch /etc/yum.repos.d/nginx.repo



cat >>/etc/yum.repos.d/nginx.repo<<EOF
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/\$releasever/\$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
 EOF
sudo yum install nginx

 sudo systemctl start nginx



use:


the configuration file is named nginx.conf and placed in the directory /usr/local/nginx/conf/etc/nginx, or /usr/local/etc/nginx.
配置文件:
 /etc/nginx/nginx.conf 

可执行文件在:

/usr/sbin/nginx

启动:

systemctl start nginx

80端口

pid文件

/run/nginx.pid

nginx -s signal

Where signal may be one of the following:

  • stop — fast shutdown
  • quit — graceful shutdown
  • reload — reloading the configuration file
  • reopen — reopening the log files
nginx -s quit
nginx -s reload
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值