黑猴子的家:Nginx 命令

1、nginx启动命令

[root@hadoop102 nginx]# cd /usr/local/nginx
[root@hadoop102 nginx]# pwd
/usr/local/nginx

[root@hadoop102 nginx]# ll
drwxr-xr-x. 2 root root 4096 11月 14 17:14 conf
drwxr-xr-x. 2 root root 4096 11月 14 17:14 html
drwxr-xr-x. 2 root root 4096 11月 14 17:14 logs
drwxr-xr-x. 2 root root 4096 11月 14 17:14 sbin

//-c 是 指定 配置文件,也可以直接把配置文件 复制过来
[root@hadoop102 nginx]# sbin/nginx -c \
/opt/software/nginx/nginx-1.11.1/conf/nginx.conf

9193428-868c7a105cff3396.png

2、nginx无法启动

nginx无法启动: libpcre.so.1/libpcre.so.0: cannot open shared object file解决办法

(1)64位 解决方法

[root@hadoop102 nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64

(2)32位 解决方法

[root@hadoop102 nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib

3、nginx关闭命令

[root@hadoop102 ~]# cd /usr/local/nginx/
[root@hadoop102 nginx]# sbin/nginx -s stop

4、nginx重新加载命令

修改配置后重新加载生效

[root@hadoop102 ~]# cd /usr/local/nginx/
[root@hadoop102 nginx]# sbin/nginx -s reload

5、设置nginx为自启动服务

[root@hadoop102 ~]# vim /etc/rc.d/rc 
 /usr/local/nginx/sbin/nginx

6、平滑重启nginx

[root@hadoop102 ~]# ps -ef | grep nginx
89673
[root@hadoop102 ~]# kill -HUP 89673

7、完整有序的停止nginx

quit

8、重新打开日志文件

[root@hadoop102 ~]# nginx -s reopen
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值