Nginx管理命令

5,678次阅读
没有评论

共计 864 个字符,预计需要花费 3 分钟才能阅读完成。

Nginx管理命令
查看软件版本及已编译参数

[root@localhost conf]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx-1.12.2 --with-mail_ssl_module --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module

检测Nginx配置文件语法有无问题,推荐启动和重启程序前都测试下。

[root@localhost conf]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.12.2/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.12.2/conf/nginx.conf test is successful

启动Nginx

[root@localhost conf]# /usr/local/nginx/sbin/nginx

重新加载Nginx配置,配置文件修改后利用此命令可以避免重新启动Nginx程序使修改过的配置立即生效

[root@localhost conf]# /usr/local/nginx/sbin/nginx -s reload

停止Nginx

[root@localhost conf]# /usr/local/nginx/sbin/nginx -s stop

正文完
 0
Yvan
版权声明:本站原创文章,由 Yvan 于2018-03-04发表,共计864字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)