参考:https://www.phusionpassenger.com/library/install/nginx/install/oss/rubygems_rvm/

Starting Nginx

You can start Nginx by running:

Copy$ sudo /opt/nginx/sbin/nginx
Shutting down Nginx

You can shut down Nginx by killing its PID with the kill command. To find out what Nginx's PID is, use the ps command. For example:

Copy$ ps auxw | grep nginx
root          ?        S    Jan01   : nginx: master process /opt/nginx/sbin/nginx
www-data      ?        S    Jan01   : nginx: worker process
Here we see that the Nginx master process has PID  (you can ignore the worker process), so we run:

Copy$ sudo kill 25817
Having to perform two steps is a bit cumbersome. Luckily, there is an easier way to do this. By default, Nginx creates a PID file in /opt/nginx/logs/nginx.pid. This PID file contains Nginx's current PID. So we can use a single command to shutdown Nginx:

Copy$ sudo kill $(cat /opt/nginx/logs/nginx.pid)
Restarting Nginx

Restarting Nginx is the same as shutting down Nginx, and starting it again. For example:

Copy$ sudo kill $(cat /opt/nginx/logs/nginx.pid)
$ sudo /opt/nginx/sbin/nginx

Nginx启动与停止的更多相关文章

  1. Nginx学习——Nginx启动、停止、重启和信号控制以及平滑升级

    1.Nginx 启动与停止 (1)启动方式 启动格式:Nginx可执行文件地址 -c Nginx配置文件地址 /etc/local/nginx/sbin/nginx -c /root/dufy/ngi ...

  2. Ubuntu下Nginx启动、停止等常用命令

    本文详细介绍Ubuntu下Nginx启动.停止等常用命令.在开发过程中,我们会经常的修改Nginx的配置文件,每次修改配置文件都可以先测试下本次修改的配置文件是否正确,可以利用以下命令: servic ...

  3. Nginx 启动、停止、平滑重启和平滑升级 graceful shutdown of worker processes

    Controlling nginx http://nginx.org/en/docs/control.html nginx can be controlled with signals. The pr ...

  4. nginx启动、停止重启

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

  5. linux配置Nginx启动,停止

    Nginx 启动.重启.停止脚本   第一步 先运行命令关闭nginx sudo kill `cat /usr/local/nginx/logs/nginx.pid`   第二步 vi /etc/in ...

  6. nginx启动,停止,重启

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

  7. nginx 启动,停止和重新加载配置

    要启动nginx的,运行可执行文件.一旦nginx的启动时,它可以通过与-s参数调用可执行来控制.使用以下语法 nginx -s signal 其中,信号可以是下列之一: stop - fast sh ...

  8. Nginx启动、停止与平滑重启

    如何启动Nginx:/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 停止Nginx:可以发送向通信号给Nginx主进程的 ...

  9. Nginx启动和停止

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

  10. nginx启动、停止、重启

    转自https://www.cnblogs.com/wangcp-2014/p/9922845.html 启动 启动代码格式:nginx安装目录地址 -c nginx配置文件地址 例如: [root@ ...

随机推荐

  1. Servlet基本用法二接口和类

    转自:http://www.cnblogs.com/xujian2014/p/4536168.html 一.摘要 本文主要简单介绍开发Servlet需要用到的接口和类. 二.ServletReques ...

  2. Oracle 修改表名

    .ALTER TABLE T_PLAT_KEYWORD_STATISTIC RENAME TO T_PLAT_KEYWORD; .create new_table as select * from o ...

  3. appium for mac 安装与测试ios说明

    一.安装 安装dmg,可以自己下载appium-1.4.0.dmg或者找rtx我要,文件过大不能添加附件. Appium提供了一个doctor,运行appium-doctor 如果有问题,Fix it ...

  4. 转MQTT--mosquitto服务器系统内容主题

    MQTT客户端可以通过订阅位于$SYS层次下的主题来查看mosquitto服务器的状态信息.标记为Static的主题对于每一次订阅只发布一次.其它所有主题每隔sys_interval(在mosquit ...

  5. 多数据源动态关联报表的制作(birt为例)

    使用Jasper或BIRT等报表工具时,常会碰到一些很规的统计,用报表工具本身或SQL都难以处理,比方与主表相关的子表分布在多个数据库中,报表要展现这些数据源动态关联的结果.集算器具有结构化强计算引擎 ...

  6. oracle浅析导致数据库性能问题的常见原因

    ㈠ 不合理的大表全表扫描 详见:点击打开链接 v$session_longops视图记录了超过6秒的所有SQL语句        这其中绝大部是全表扫描的语句! ㈡ 语句共享性不好 常出没在OLTP, ...

  7. sersync简介与测试报告

    在分布式应用中会遇到一个问题,就是多个服务器间的文件如何能始终保持一致.一种经典的办法是将需要保持一致的文件存储在NFS上,这种方法虽然简单方便但却将本来多点的应用在文件存储上又变成了单点,这违背了分 ...

  8. 2018年EI收录中文期刊目录【转】

    [转]2018年EI收录中文期刊目录 Elsevier官网于2018年1月1日更新了EI Compendex目录,共收录中文期刊158种,其中新增期刊5种. 序号 中文刊名 收录情况 1 声学学报 保 ...

  9. linux下性能测试工具netperf使用

    一.功能简介 netperf是一款针对网络性能的测试工具,主要基于TCP或UDP的传输.根据应用的不同,可以进行批量数据传输(bulk data transfer)模式和请求/应答(request/r ...

  10. 今天学习Ibatis,花了我一个下午的时间,程序猿呀,你上点心吧

    今天花了半天的时间完成了一个小小小的项目 烦了两个错误:第一个没有对Dao层进行实例化, 第二个错误是: 给数据表其错了名字,现在很混乱呀 不能其Content相似的名字呀! 还是等心情平复了再写日记 ...