windows下实现nginx开机自启

用Windows Service Wrapper工具实现windows下实现nginx开机自启。html

  • 下载工具地址我已经打包 下载地址 用的是winsw-1.19-bin.exe 解压至nginx安装目录service

输入图片说明

  • 修改路径

输入图片说明

<service>
  <id>NginxService</id>
  <name>NginxService</name>
  <description>NginxService</description>
  <executable>C:\YaleSoftFiles\Develop\nginx-1.11.3\nginx.exe</executable>
  <logpath>C:\YaleSoftFiles\Develop\nginx-1.11.3\service\log</logpath>
  <logmode>roll</logmode>
  <depend></depend>
  <startargument>-p</startargument>
  <startargument>C:\YaleSoftFiles\Develop\nginx-1.11.3</startargument>
  <stopexecutable>C:\YaleSoftFiles\Develop\nginx-1.11.3\nginx.exe</stopexecutable>
  <stopargument>-p</stopargument>
  <stopargument>C:\YaleSoftFiles\Develop\nginx-1.11.3</stopargument>
  <stopargument>-s</stopargument>
  <stopargument>stop</stopargument>
</service>
  • 进入windows-->system32-->右键“以管理员的方式打开”cmd.exenginx

  • 进入service目录执行installService.batwindows

  • 命令行:services.mscapp

输入图片说明

  • 卸载服务:
sc delete NginxService

参考:http://www.cnblogs.com/xusion/articles/3035327.html工具

相关文章
相关标签/搜索