查看nginx进程看看有没有启动,并可以查看进程ID
[root@tc3 nginxcs]# ps -ef|grep nginx
root 20538 1 0 13:51 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
root 20539 20538 0 13:51 ? 00:00:00 nginx: worker process
root 20540 20538 0 13:51 ? 00:00:00 nginx: worker process
root 24132 1 0 15:03 ? 00:00:00 nginx: master process sbin/nginx
nobody 24133 24132 0 15:03 ? 00:00:00 nginx: worker process
root 24552 20113 0 15:12 pts/2 00:00:00 grep nginx
[root@tc3 nginxcs]#
停止nginx,其实就是杀掉进程,但是要注意不能用kill -9 进程id,因为nginx启动时有子进程,所以要用下面方式杀死
[root@tc3 nginxcs]# ps -ef|grep nginx
root 20538 1 0 13:51 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
root 20539 20538 0 13:51 ? 00:00:00 nginx: worker process
root 20540 20538 0 13:51 ? 00:00:00 nginx: worker process
root 20544 1 0 13:51 ? 00:00:00 nginx: master process /opt/nginxcs/sbin/nginx
nobody 24052 20544 0 15:02 ? 00:00:00 nginx: worker process
root 24066 20113 0 15:02 pts/2 00:00:00 grep nginx
[root@tc3 nginxcs]# kill 20544
[root@tc3 nginxcs]# ps -ef|grep nginx
root 20538 1 0 13:51 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
root 20539 20538 0 13:51 ? 00:00:00 nginx: worker process
root 20540 20538 0 13:51 ? 00:00:00 nginx: worker process
root 24104 20113 0 15:03 pts/2 00:00:00 grep nginx
[root@tc3 nginxcs]#
启动nginx
[root@tc3 nginxcs]# ps -ef|grep nginx
root 20538 1 0 13:51 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
root 20539 20538 0 13:51 ? 00:00:00 nginx: worker process
root 20540 20538 0 13:51 ? 00:00:00 nginx: worker process
root 24104 20113 0 15:03 pts/2 00:00:00 grep nginx
[root@tc3 nginxcs]# sbin/nginx
[root@tc3 nginxcs]# ps -ef|grep nginx
root 20538 1 0 13:51 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
root 20539 20538 0 13:51 ? 00:00:00 nginx: worker process
root 20540 20538 0 13:51 ? 00:00:00 nginx: worker process
root 24132 1 0 15:03 ? 00:00:00 nginx: master process sbin/nginx
nobody 24133 24132 0 15:03 ? 00:00:00 nginx: worker process
root 24139 20113 0 15:03 pts/2 00:00:00 grep nginx
[root@tc3 nginxcs]#
分享到:
相关推荐
启动操作 命令: nginx -c /usr/nginx/conf/nginx.conf -c参数指定了要加载的nginx配置文件路径。 停止操作 停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文章)来进行的 步骤1:查询nginx主进程号 ps...
windows 环境下nginx 启动,停止,重启脚本 解决windows 环境下 双击nginx.exe重启后不会停止上一次进程问题。
Nginx 常用启动、停止、重启命令.pdf
nginx免安装版,放到项目下面直接可用;里面包含nginx服务启动/停止/重启的bat程序;配置文件也配好已测试过,其中html文件夹为前端包。
echo nginx一键启动,停止,查看..... read -ep 请输入你的操作,1.stop,2.start,3.reload,4.status(1,2,3,4): nginx1 case $nginx1 in 1) netstat -nlpt | grep nginx > /dev/null if [ $? -eq 0 ];then pkill -15 ...
在Windows下使用Nginx,我们需要掌握一些基本的操作命令,今天为大家分享几个Windows下操作Nginx的基本命令
启动操作 nginx -c /usr/local/nginx/conf/nginx.conf -c参数指定了要加载的nginx配置文件路径 停止操作 停止操作是通过向nginx进程发送信号来进行的 步骤1:查询nginx主进程号 ps -ef | grep nginx 在进程列表...
服务器上的Nginx和PHP都是...一、Nginx启动脚本/etc/init.d/nginx 代码如下: #!/bin/bash # # Startup script for Nginx – this script starts and stops the nginx daemon # # chkconfig: – 85 15 # description:
2.4 Nginx的启动、 停止、 平滑重启 2.5 Nginx的平滑重启 2.6 Nginx的信号控制 2.7 Nginx的平滑升级 第2部分 进阶篇 第3章 Nginx的基本配置与优化 3.1 Nginx的完整配置示例 3.2 Nginx的虚拟主机配置 3.3 Nginx的日志...
一、安装 ...如果是macOS 1.12以上的系统,在安装过程中可能会出现”warning”,说是不支持该版本的操作系统,可以暂时先忽略它。 二、启动 在终端中输入 ps -ef|grep nginx 如果执行的结果是 501 15800
停止nginx: stop.bat 重启nginx: restart.bat 将nginx注册为系统服务: (1)首先修改nginx-service.xml,把里面nginx的位置信息改为你的nginx信息,我这里nginx是直接解压到D盘,如果放在其他位置,替换掉D:\...
2.4 Nginx的启动、停止、平滑重启 2.5 Nginx的平滑重启 2.6 Nginx的信号控制 2.7 Nginx的平滑升级 第2部分 进 阶 篇 第3章 Nginx的基本配置与优化 3.1 Nginx的完整配置示例 3.2 Nginx的虚拟主机配置 3.3 ...
网上找了许久,下载了几个文档,然而都不能...停止/重新加载:/usr/local/nginx/sbin/nginx -s stop(quit、reload) 验证配置文件是否合法:/usr/local/nginx/sbin/nginx -t 命令帮助:/usr/local/nginx/sbin/nginx –h
2.4 Nginx的启动、停止、平滑重启 2.5 Nginx的平滑重启 2.6 Nginx的信号控制 2.7 Nginx的平滑升级 第2部分 进 阶 篇 第3章 Nginx的基本配置与优化 3.1 Nginx的完整配置示例 3.2 Nginx的虚拟主机配置 3.3 Nginx的日志...
前言 自己通过nginx uwsgi 部署...#启动nginx sudo /etc/init.d/nginx start #重启nginx 8sudo /etc/init.d/nginx restart #停止nginx sudo /etc/init.d/nginx stop #很暴力的方法,我喜欢 sudo killall nginx 安装
nginx安装,启动,停止,重启,开机自启动等等运维手册。
Linux下Nginx的安装部署 1、手动下载安装包 2、解压、编译安装 3、启动、停止、重启 nginx 4、开机自启动 5、环境配置
./nginx -s stop –快速停止nginx 也可以ps -ef|grep ninx kill -9 进程号 直接启动nginx,常用语第一次启 ./sbin/nginx -c conf/nginx.conf nginx检查配置 ./nginx -t –echo出来 success或者fail nginx重启 ./nginx...