转自https://www.cnblogs.com/wangcp-2014/p/9922845.html

启动

启动代码格式:nginx安装目录地址 -c nginx配置文件地址

例如:

[root@LinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

停止

nginx的停止有三种方式:

  • 从容停止

  1、查看进程号

[root@LinuxServer ~]# ps -ef|grep nginx

  2、杀死进程

[root@LinuxServer ~]# kill -QUIT 2072

  • 快速停止

1、查看进程号

[root@LinuxServer ~]# ps -ef|grep nginx

2、杀死进程

[root@LinuxServer ~]# kill -TERM 2132
或 [root@LinuxServer ~]# kill -INT 2132

  • 强制停止

[root@LinuxServer ~]# pkill -9 nginx

重启

1、验证nginx配置文件是否正确

方法一:进入nginx安装目录sbin下,输入命令./nginx -t

看到如下显示nginx.conf syntax is ok

nginx.conf test is successful

说明配置文件正确!

方法二:在启动命令-c前加-t

2、重启Nginx服务

方法一:进入nginx可执行目录sbin下,输入命令./nginx -s reload 即可

方法二:查找当前nginx进程号,然后输入命令:kill -HUP 进程号 实现重启nginx服务

nginx启动、停止、重启的更多相关文章

  1. nginx 启动/停止/重启

    启动: -c filename   : set configuration file (default: conf/nginx.conf) [root@LinuxServer sbin]# /usr/ ...

  2. nginx 启动/停止/重启 BAT

    cls @ECHO OFF SET NGINX_PATH=D: SET NGINX_DIR=D:\Hack\nginx\color 0a TITLE Nginx 管理程序 Power By AntsG ...

  3. nginx启动,重启,关闭命令

    nginx启动,重启,关闭命令 停止操作停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的步骤1:查询nginx主进程号ps -ef | grep nginx在进程列表 ...

  4. Linux Systemd——在RHEL/CentOS 7中启动/停止/重启服务

    RHEL/CentOS 7.0中一个最主要的改变,就是切换到了systemd.它用于替代红帽企业版Linux前任版本中的SysV和Upstart,对系统和服务进行管理.systemd兼容SysV和Li ...

  5. 批处理命令行CMD启动停止重启IIS的命令

    原文:批处理命令行CMD启动停止重启IIS的命令 启动IIS: net start iisadmin    (IIS的整个服务) net start w3svc       (WWW网页WEB服务) ...

  6. 在CentOS 7中启动/停止/重启服务

    RHEL/CentOS 7.0中一个最主要的改变,就是切换到了systemd.它用于替代红帽企业版Linux前任版本中的SysV和Upstart,对系统和服务进行管理.systemd兼容SysV和Li ...

  7. linux如何启动/停止/重启MySQL

    如何启动/停止/重启MySQL 一.启动方式 1.使用 service 启动:service mysqld start2.使用 mysqld 脚本启动:/etc/inint.d/mysqld star ...

  8. Linux下启动,停止,重启Nginx、Mysql、PHP

    LINUX启动Nginx的命令: 一.查询是否启动 [root@jiang php-fpm.d]# ps -ef | grep nginx root 25225 1 0 19:26 ? 00:00:0 ...

  9. nginx mac 下启动 停止 重启,查看安装位置

    Nginx的启动.停止与重启   启动 启动代码格式:nginx安装目录地址 -c nginx配置文件地址 例如: [root@LinuxServer sbin]# /usr/local/nginx/ ...

  10. 【nginx】常用命令 启动|停止|重启|重新读取配置-centOS7

     查看服务的当前状态 (flaskApi) [root@67 goTest]# systemctl status nginx.service ● nginx.service - The nginx H ...

随机推荐

  1. HR,OA,CRM,DRP,ERP什么意思?电商行业的特点?电商行业模式?专业术语?

    HR,OA,CRM,DRP,ERP HR----Human Resource人力资源管理 OA----Office Automation办公自动化 CRM---Customer Relationshi ...

  2. 【JulyEdu-Python基础】第 3 课:容器以及容器的访问使用

    大纲 容器切片 list/tupledictset 切片 列表推导 生成器 迭代器 容器 list 列表 序列是Python中最基本的数据结构.序列中的每个元素都分配一个数字 - 它的位置,或索引,第 ...

  3. 应用安全 - PHP - CMS - EmpireCMS - 漏洞 - 汇总

    2006 Empire CMS <= 3.7 (checklevel.php) Remote File Include Vulnerability Empire CMS Checklevel.P ...

  4. 应用安全 - 社工 - 大数据 - Fofa - 汇总

    搜索语法 title=”abc”   header=”abc”  body=”abc”  domain=”xx.com”  host=”.xx.cn”  port=”443”     ip=”1.1. ...

  5. 【Linux开发】linux设备驱动归纳总结(三):5.阻塞型IO实现

    linux设备驱动归纳总结(三):5.阻塞型IO实现 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...

  6. mysql——操作数据库

    一.查看数据库 show databases; 二.创建数据库 create database 数据库名; 三.删除数据库 drop database 数据库名; 四.查看数据库存储引擎 show e ...

  7. filter方法常用过滤条件

    #encoding: utf-8 from sqlalchemy import create_engine,Column,Integer,String,Float,func,and_,or_ from ...

  8. json字符串转成 json对象 json对象转换成java对象

    import com.alibaba.fastjson.JSONArray;import com.alibaba.fastjson.JSONObject; 依赖包 <dependency> ...

  9. Oracle 用户管理权限

    Oracle 用户管理权限 一.创建用户的Profile文件 SQL> create profile student limit // student为资源文件名 FAILED_LOGIN_AT ...

  10. JavaScript中好用的对象数组去重

    对象数组去重 Demo数据如下: var items= [{ "specItems": [{ "id": "966480614728069122&qu ...