在Windows下使用Nginx,我们需要掌握一些基本的操作命令,比如:启动、停止Nginx服务,重新载入Nginx等,下面我就进行一些简单的介绍。
1、启动:
?
1 |
C:\\server\\nginx-1.0.2>start nginx |
或
?
1 |
C:\\server\\nginx-1.0.2>nginx.exe |
注:建议使用第一种,第二种会使你的cmd窗口一直处于执行中,不能进行其他命令操作。
2、停止:
?
1 |
C:\\server\\nginx-1.0.2>nginx.exe -s stop |
或
?
1 |
C:\\server\\nginx-1.0.2>nginx.exe -s quit |
注:stop是快速停止nginx,可能并不保存相关信息;quit是完整有序的停止nginx,并保存相关信息。
3、重新载入Nginx:
?
1 |
C:\\server\\nginx-1.0.2>nginx.exe -s reload |
当配置信息修改,需要重新载入这些配置时使用此命令。
4、重新打开日志文件:
?
1 |
C:\\server\\nginx-1.0.2>nginx.exe -s reopen |
5、查看Nginx版本:
?
1
2
3 |
C:\\server\\nginx-1.0.2>nginx - v
nginx: nginx version: nginx /1 .0.2 |
或
?
1
2
3
4
5 |
C:\\server\\nginx-1.0.2>nginx -V
nginx: nginx version: nginx /1 .0.2
nginx: TLS SNI support enabled
nginx: configure arguments: --builddir=objs.msvc8 --crossbuild=win32 --with-debug --prefix= --conf-path=conf /nginx .conf --pid-path=logs /nginx .pid --http-log-path=logs /access .log --error-log-path=logs /error .log --sbin-path=nginx.exe --http-client-body-temp-path=temp /client_body_temp --http-proxy-temp-path=temp /proxy_temp --http-fastcgi-temp-path=temp /fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8 /lib/pcre-7 .9 --with-zlib=objs.msvc8 /lib/zlib-1 .2.3 --with-select_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-mail --with-ipv6 --with-openssl=objs.msvc8 /lib/openssl-0 .9.8r --with-openssl-opt= enable -tlsext --with-http_ssl_module --with-mail_ssl_module |
注:v只是简单显示版本信息,V不但显示版本信息,还显示配置参数信息。
6、测试或载入指定配置文件:
测试配置文件
?
1
2
3
4 |
C:\\server\\nginx-1.0.2>nginx.exe -t -c conf /default .conf
nginx: the configuration file C:\\server\\nginx-1.0.2 /conf/default .conf syntax isok
nginx: configuration file C:\\server\\nginx-1.0.2 /conf/default .conf test is successful |
载入指定配置文件
?
1 |
C:\\server\\nginx-1.0.2>start nginx.exe -c conf /default .conf |
本文介绍的这几个命令都是非常基础的,很空间记住,多尝试几次就可以了
原文链接:https://www.cnblogs.com/52php/p/5672446.html
相关文章
猜你喜欢
- ASP.NET自助建站系统的数据库备份与恢复操作指南 2025-06-10
- 个人网站服务器域名解析设置指南:从购买到绑定全流程 2025-06-10
- 个人网站搭建:如何挑选具有弹性扩展能力的服务器? 2025-06-10
- 个人服务器网站搭建:如何选择适合自己的建站程序或框架? 2025-06-10
- 64M VPS建站:能否支持高流量网站运行? 2025-06-10
TA的动态
- 2025-07-10 怎样使用阿里云的安全工具进行服务器漏洞扫描和修复?
- 2025-07-10 怎样使用命令行工具优化Linux云服务器的Ping性能?
- 2025-07-10 怎样使用Xshell连接华为云服务器,实现高效远程管理?
- 2025-07-10 怎样利用云服务器D盘搭建稳定、高效的网站托管环境?
- 2025-07-10 怎样使用阿里云的安全组功能来增强服务器防火墙的安全性?
快网idc优惠网
QQ交流群
您的支持,是我们最大的动力!
热门文章
-
2025-05-25 102
-
2025-05-29 75
-
2025-05-27 42
-
2025-05-27 103
-
2025-05-25 88
热门评论