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工具

相關文章
相關標籤/搜索