Nginx日常维护的命令
2016-04-06 10:04
639 查看
Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,Nginx的安装不是很复杂,下面主要讲解下日常维护中Nginx常用的一些命令,以下命令都在Nginx的sbin目录下执行。
1、显示相关帮助
./nginx -h
nginx version: nginx/1.6.2
Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
2、检测配置文件
./nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
3、启动 Nginx
./nginx
4、重载配置
./nginx -s reload
5、停止 Nginx
./nginx -s stop
./nginx -s quit
stop与quit参数的区别在于stop是快速停止nginx,可能并不保存相关信息,quit是完整有序的停止nginx,并保存相关信息。
6、指定配置文件
./nginx -c /usr/local/nginx/conf/nginx.conf
7、 查看 Nginx 版本
./nignx -v
nginx version: nginx/1.6.2
./nginx -V
nginx version: nginx/1.6.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
TLS SNI support enabled
configure arguments: --with-http_image_filter_module --with-http_ssl_module --with-http_gzip_static_module
1、显示相关帮助
./nginx -h
nginx version: nginx/1.6.2
Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
2、检测配置文件
./nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
3、启动 Nginx
./nginx
4、重载配置
./nginx -s reload
5、停止 Nginx
./nginx -s stop
./nginx -s quit
stop与quit参数的区别在于stop是快速停止nginx,可能并不保存相关信息,quit是完整有序的停止nginx,并保存相关信息。
6、指定配置文件
./nginx -c /usr/local/nginx/conf/nginx.conf
7、 查看 Nginx 版本
./nignx -v
nginx version: nginx/1.6.2
./nginx -V
nginx version: nginx/1.6.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
TLS SNI support enabled
configure arguments: --with-http_image_filter_module --with-http_ssl_module --with-http_gzip_static_module
相关文章推荐
- mac 安装 nginx 环境
- Nginx 的编译安装和URL地址重写
- LINUX测试环境部署nginx(五)
- Nginx将请求分发到各web应用
- Nginx负载均衡
- nginx
- Nginx On rhel6.4
- 使用Nginx+FFMPEG搭建HLS直播转码服务器
- nginx配置多站点
- 10分钟搭建 nginx +php +mysql(LNMP)此为线上环境配置专用
- Nginx的负载均衡 - 加权轮询 (Weighted Round Robin) 下篇
- Nginx的负载均衡 - 加权轮询 (Weighted Round Robin) 上篇
- centos 7 安装nginx
- Nginx的负载均衡 - 最少连接 (least_conn)
- Nginx的负载均衡 - 保持会话 (ip_hash)
- Nginx的负载均衡 - 一致性哈希 (Consistent Hash)
- nginx字体文件配置
- yum install nginx
- Nginx 这么详细 你不服不好使
- nginx 解决session共享问题(jvm-route)方式(其实没有真正解决共享问题)