黑猴子的家:Nginx 命令,猴子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

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

相关内容

    暂无相关文章