linux下nginx查看、启动、重启、关闭

您所在的位置:网站首页 linux关闭进程自启动 linux下nginx查看、启动、重启、关闭

linux下nginx查看、启动、重启、关闭

2024-07-10 06:24| 来源: 网络整理| 查看: 265

设置开机自启动 ystemctl enable nginx.service 停止开机自启动 systemctl disable nginx.service 查看当前状态 systemctl status nginx.service 查看所有已启动的服务 systemctl list-units --type=service 查看 ps -ef|grep nginx 第一种方式

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

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf systemctl start nginx.service  停止 kill -QUIT 进程号 kill -TERM 进程号 kill -INT 进程号 强制停止 pkill -9 nginx systemctl stop nginx.service 验证

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

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

2、重启  

方法一:进入nginx可执行目录sbin下,输入命令

./nginx -s reload systemctl restart nginx.service

方法二:查找当前nginx进程号,然后输入命令: kill -HUP 进程号

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3