共计 700 个字符,预计需要花费 2 分钟才能阅读完成。
1. 下载 nginx nginx
2. 下载 Windows Service Wrapper
github 下载地址
网盘下载地址
3. 将下载的 winsw 的名字批改为 nginx-service.exe
搁置于ningx
目录下
4. 新建文件 nginx-service.xml
内容如下(也搁置于nginx
目录下):
<!-- nginx-service.xml -->
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<logpath>D:\SoftRepository\DevelopmentTools\nginx-1.16.1</logpath>
<logmode>roll</logmode>
<depend></depend>
<executable>D:\SoftRepository\DevelopmentTools\nginx-1.16.1\nginx.exe</executable>
<stopexecutable>D:\SoftRepository\DevelopmentTools\nginx-1.16.1\nginx.exe -s stop</stopexecutable>
</service>
其中 logpath
,executable
,executable
中的门路对应批改为本人的 nginx 门路
5. 而后咱们在命令行(管理员模式,不然权限不够)中,将该服务注册到 windows 零碎之中:
nginx-service install
6. 查看工作管理器
!
曾经有 nginx 的服务了 点击启动
7. 关机重启会发现 nginx 不须要命令行就曾经启动了
正文完