【nginx】nginx日常命令
看下nginx命令的帮助信息
[root@localhost oa_workflow_test]# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/1.12.
Usage: nginx [-?hvVtTq] [-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
-T : test configuration, dump it 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
查看nginx版本
[root@localhost ~]# nginx -v (注意是小v)
nginx version: nginx/1.12.
查看nginx安装了哪些模块
[root@localhost ~]# nginx -V(注意是大V)
nginx version: nginx/1.12.
built by gcc 4.8. (Red Hat 4.8.-) (GCC)
built with OpenSSL 1.0.1e-fips Feb
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-threads
可以格式化后显示
[root@localhost ~]# nginx -V >& | sed "s/\s\+--/\n --/g"
nginx version: nginx/1.12.
built by gcc 4.8. (Red Hat 4.8.-) (GCC)
built with OpenSSL 1.0.1e-fips Feb
TLS SNI support enabled
configure arguments:
--user=www
--group=www
--prefix=/usr/local/nginx
--with-http_ssl_module
--with-http_stub_status_module
--with-threads
重读nginx配置文件
[root@localhost conf]# /usr/local/nginx/sbin/nginx -s reopen
检查配置文件是否正确
-t 参数 ,不运行nginx,而仅仅测试配置文件。nginx 将检查配置文件的语法的正确性,并尝试打开配置文件中所引用到的文件。
[root@localhost conf]# /usr/local/nginx/sbin/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
后面也可以指定配置文件地址
[root@oa-dev conf]# /opt/app/nginx/sbin/nginx -t -c /opt/app/nginx/conf/nginx.conf
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/opt/app/nginx/conf/ssl/server2018.crt"
nginx: the configuration file /opt/app/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/app/nginx/conf/nginx.conf test is successful
查看nginx进程信息
[root@oa-dev conf]# ps -ef|grep nginx
root : ? :: nginx: master process /opt/app/nginx/sbin/nginx
nobody : ? :: nginx: worker process
nobody : ? :: nginx: worker process
nginx -h 查看帮助信息
nginx -v 查看Nginx的版本号
nginx -V 显示Nginx的版本号和编译信息
start nginx 启动Nginx
nginx -s stop 快速停止和关闭Nginx
nginx -s quit 正常停止或关闭Nginx
nginx -s reload 配置文件修改重新加载
nginx -t 测试Nginx配置文件的正确性及配置文件的详细信息
【nginx】nginx日常命令的更多相关文章
- nginx的日常应用
nginx的配置文件nginx.conf配置详解如下: user nginx nginx ; Nginx用户及组:用户 组.window下不指定 worker_processes ; 工作进程:数目. ...
- Nginx启动停止命令
操作环境是Windows 一.nginx命令:启动nginx 在Windows上安装好nginx后,我们需要启动nginx服务,启动nginx服务的命令行操作主要有两种方式,即 cd D:\opens ...
- window下nginx的常用命令
window nginx 启动 常用命令 2016-05-04 11:11 214人阅读 评论(0) 收藏 举报 分类: nginx(5) 版权声明:本文为博主原创文章,未经博主允许不得转载. 启动 ...
- nginx 支持的命令行参数
Command-line parameters 命令行参数 nginx supports the following command-line parameters: nginx支持以下命令行参数 - ...
- ubuntu和centos 编译安装nginx及常用命令
转自http://www.cnblogs.com/piscesLoveCc/p/5794926.html 一. ubuntu安装 1. 安装依赖库 安装gcc g++的依赖库 ubuntu平台可以使用 ...
- nginx中有关命令和日志切割,配置文件加载的详细阐述
一.Nginx简介 Nginx (“engine x”) 是俄罗斯人Igor Sysoev(塞索耶夫)编写的一款高性能的 HTTP 和反向代理服务器.Nginx 已经在俄罗斯最大的门户网站── Ram ...
- linux安装jdk tomcat nginx 以及常用命令
linux: 操作系统,应用服务器上 常用命令: cd 切换命令 cd / cd ~ cd ../../ cd xx ll 展示所有的文件 ll -h 友好的展示 mkdir 创建目录 mkdir 目 ...
- 配置nginx的systemctl命令
启动nginx的命令为 /usr/local/nginx/sbin/nginx 停止nginx的命令为 /usr/local/nginx/sbin/nginx -s stop 重启ng ...
- nginx配置, 启动命令, 反向代理配置
2014年1月3日 13:52:07 喜欢这样的风格,干货 http://huoding.com/2013/10/23/290 -----------------下边是我自己的经验(windows)- ...
随机推荐
- net view 提示6118错误 解决方法。
1.win+R ,输入services.msc 开启服务:Server ,WorkStation,computer Browser 2.如果你的电脑没有computer Browser服务,win+R ...
- Mina的IoBuffer改造成Netty的ByteBuff
背景:部标GPS通讯底层全部改造成基于Netty服务器实现的,现将Mina的依赖移除,修改过程中有用到缓冲区的读写.现做了如下修改: 原有基于Mina的IoBuffer对字节读写封装代码如下: pac ...
- Asp.net Core应用程序部署为服务
安装前使用dotnet命令运行下看网站能不能正常运行 1.下载nssm,下载后解压文件 下载地址:https://nssm.cc/usage 2.使用命令行工具进入到nssm的目录: 3.执行服务安装 ...
- linux FTP安全配置
linux FTP安全配置 关闭防火墙,selinux安全机制 service iptables stop setenforce 0 匿名用户 匿名用户只能访问ftp服务器上的/var/ftp/ ...
- git执行cherry-pick时修改提交信息
git执行cherry-pick时修改提交信息 在本地分支执行cherry-pick命令时有时需要修改commit message信息,可以加参数-e实现: git cherry-pick -e co ...
- python进阶之正则表达式
概念: 正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符.及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑. 目的? 给定一个正则表 ...
- MySql 学习之路-基础
Mysql 自学之路 本文包含基础部分与高级部分 一.基础 数据库操作 Show databases:显示所有的数据库 Show tables: 显示所有的数据库表 Use databasename: ...
- 英语口语练习系列-C14-常用片语
句子 1. Some ads are extremely persuasive and we find we buy products we don't really need. 有一些广告非常有说服 ...
- 《PHP扩展及核心》
本文地址:http://www.cnblogs.com/aiweixiao/p/8202365.html 原文地址: 欢迎关注微信公众号 程序员的文娱情怀 一.主要内容: 1️⃣php扩展的概念和底 ...
- 7 Best Free RAR Password Unlocker Software For Windows
Here is the list of Best Free RAR Password Unlocker Software for Windows. These software run differe ...