windows下实现nginx开机自启

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

  • 下载工具地址我已经打包 下载地址 用的是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.exe

  • 进入service目录执行installService.bat

  • 命令行:services.msc

输入图片说明

  • 卸载服务:
sc delete NginxService

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

转载于:https://my.oschina.net/yale8848/blog/750657

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值