Linux下的nginx启动、重新启动
2015-09-20 19:16
525 查看
nginx的启动命令是:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
-c制定配置文件的路径,不加-nginx会自动加载默认路径的配置文件。
以上是通用的启动命令
以下是转载的,对于有以下命令的nginx可以使用,没有以下命令的nginx,可以使用上面的方法
研究了一下nginx帮助后发现,有-s参数可对nginx服务进行管理:
# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/0.7.63
Usage: nginx [-?hvVt] [-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
-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
于是我执行
# /usr/local/nginx/sbin/nginx -s reload
nginx已经重启成功
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
-c制定配置文件的路径,不加-nginx会自动加载默认路径的配置文件。
以上是通用的启动命令
以下是转载的,对于有以下命令的nginx可以使用,没有以下命令的nginx,可以使用上面的方法
研究了一下nginx帮助后发现,有-s参数可对nginx服务进行管理:
# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/0.7.63
Usage: nginx [-?hvVt] [-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
-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
于是我执行
# /usr/local/nginx/sbin/nginx -s reload
nginx已经重启成功
相关文章推荐
- Nginx Location配置总结
- HAProxy+Nginx 负载均衡
- 解析nginx负载均衡
- 简单配置nginx
- nginx防止部分DDOS攻击
- nginx负载均衡高级策略-upstream
- resin+nginx搭建高性能Java服务器
- 使用Nginx+Lua搭建AB测试平台
- nginx笔记, 安装,配置,集群
- nginx 提供静态内容
- Nginx的第三方模块ngx-fancyindex安装
- 基于多进程和基于多线程服务器的优缺点及nginx服务器的启动过程
- 搭建Nginx+JAVA环境
- nginx(五)nginx与php的安装配置
- nginx(四)初识nginx日志文件
- nginx(三)初步搭建nginx虚拟主机
- nginx学习(二):初识配置文件
- nginx学习(一):基本安装
- Nginx的配置介绍
- Ubuntu 15搭建下HHVM Nginx环境