nginx简易安装启动!

使用3A服务器搭建的centos系统安装nginx,教程在我的往期博客中,最新教程yum方式如下!

添加CentOS 7 Nginx yum资源库

rpm -Uvh  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

安装nginx

yum -y install nginx

启动nginx

systemctl start nginx

yum方式安装的默认地址和配置的默认地址

/etc/nginx/nginx.conf  //yum方式安装后默认配置文件的路径

/usr/share/nginx/html  //nginx网站默认存放目录

/usr/share/nginx/html/index.html //网站默认主页路径

手动安装nginx配置

nginx 指定配置文件

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

-c 参数 指定了要加载的nginx配置文件路径

1,从容停止Nginx:

kill -QUIT 主进程号

2,快速停止Nginx:

kill -TERM 主进程号

3,强制停止Nginx:

kill -9 主进程号

2,使用信号管理nginx 的master、worker进程

立刻停止服务:

nginx -s stop 或者

kill -SIGTERM $(cat /data/services/nginx/logs/nginx.pid)

优雅停止服务:

nginx -s quit 或者

kill -QUIT $(cat /data/services/nginx/logs/nginx.pid)

重载配置文件(master不退出,重新加载worker进程):

nginx -s reload

kill -SIGHUP $(cat /data/services/nginx/logs/nginx.pid)

重新开始记录日志文件:

nginx -s reopen 或者

kill -USR1 $(cat /data/services/nginx/logs/nginx.pid)

热升级nginx服务(主要是二进制nginx文件):

kill -USR2 old_master_process #将新的请求过度到新的master进程中去

kill -WINCH old_master_process #优雅关闭所有work进程

点赞
收藏

评论区

加载中...

相关推荐

nginx 启动、停止、关闭

使用3A服务器搭建的centos系统安装nginx教程在我的往期博客中1,nginx指定配置文件/usr/local/nginx/sbin/nginxc/usr/local/nginx/conf/nginx.conf1c参数指定了要加载的nginx配置文件路径1,从容停止Nginx:killQUIT主进程号2,快速停止Nginx:kil

Nginx 代理到Jetty 页面跳转端口改变问题

 Nginx安装 Windows下部署Nginx只需下载安装包,解压启动服务器即可。下载官网:http://nginx.org/en/download.html   操作Nginx首先进入安装文件夹: 查看版本  Nginxv 启动服务  startnginx  正常关闭服务

Linux和Windows环境下安装Nginx

Nginx的安装windows环境下安装Nginx安装Nginx的下载地址如下:http://nginx.org/en/download.html(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fngi

Nginx的安装

在一个新的centOS7.5 的系统中安装1. 安装Nginx在/etc/yum.repos.d/ 目录下新建一个文件 名为 nginx.repo  输入以下内容并保存\nginx\namenginxrepobaseurlhttp://nginx.org/packages/centos/7/$

4. Nginx模块

Nginx官方模块1.ngx\_http\_stub\_status\_modulehttp://nginx.org/en/docs/http/ngx\_http\_stub\_status\_module.html。(https://www.oschina.net/action/GoToLink?urlhttp%3A%2

Nginx安装部署

web服务器Nginx安装部署nginx源码下载官网:http://nginx.org/(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fnginx.org%2F)http://nginx.org/dow