标签:
1、下载最新版的 Windows Service Wrapper 措施,好比我下载的名称是 "winsw-1.9-bin.exe",然后,把它定名成你想要的名字(好比: "mynginx.exe",固然,,你也可以不改名)
2、把下载的文件(winsw-1.9-bin.exe)复制到nginx目录(D:\nginx-1.12.2)
3、nginx目录下创建一个同名的Windows Service Wrapper的XML配置文件(winsw-1.9-bin.xml)
文件内容如下:
<service> <id>nginx</id> <name>Nginx Service</name> <description>High Performance Nginx Service</description> <logpath>D:\nginx-1.12.2\logs</logpath> <log mode="roll-by-size"> <sizeThreshold>10240</sizeThreshold> <keepFiles>8</keepFiles> </log> <executable>D:\nginx-1.12.2\nginx.exe</executable> <startarguments>-p D:\nginx-1.12.2</startarguments> <stopexecutable>D:\nginx-1.12.2\nginx.exe</stopexecutable> <stoparguments>-p D:\nginx-1.12.2\ -s stop</stoparguments> </service>说明:
<name>Nginx Service</name> #这是处事里面名字 <description>High Performance Nginx Service</description> #这里是对处事的描述4、命令行执行安置命令
Windows Servcie Wrapper的命令格局如下:
#安置处事 CMD:\> winsw-1.9-bin.exe install #卸载处事 CMD:\> winsw-1.9-bin.exe uninstall #启动处事 CMD:\> winsw-1.9-bin.exe start #遏制处事 CMD:\> winsw-1.9-bin.exe stop#附个其时安置1.8版本时的图片
为nginx创建windows处事自启动