Advanced Interdisciplinary Projects Lab(AIPLab) 討論區

Please login or register.

請輸入帳號, 密碼以及預計登入時間

新聞:

[開學]106學年第1學期的課程看版開張了 歡迎同學問問題-20170917

作者 主題: nginx.exe as Windows system service  (閱讀 99 次)

admin

  • 管理員
  • Hero Member
  • *****
  • 文章: 1714
    • 檢視個人資料
nginx.exe as Windows system service
« 於: 八月 28, 2017, 12:50:42 am »
https://stackoverflow.com/questions/10061191/add-nginx-exe-as-windows-system-service-like-apache
1. Download the latest version of Windows Service Wrapper via github or nuget.
https://github.com/kohsuke/winsw

2. Rename winsw-xxxxx.exe to something like nginxservice.exe.
This is the name that will show up for the process that owns your nginx process.

3.Place an XML file next to the exe with the same base name, e.g. nginxservice.xml. The contents should be like below (verify your nginx location).
程式碼: [Select]
<service>
  <id>nginx</id>
  <name>nginx</name>
  <description>nginx</description>
  <executable>c:\nginx\nginx.exe</executable>
  <logpath>c:\nginx\</logpath>
  <logmode>roll</logmode>
  <depend></depend>
  <startargument>-p</startargument>
  <startargument>c:\nginx</startargument>
  <stopexecutable>c:\nginx\nginx.exe</stopexecutable>
  <stopargument>-p</stopargument>
  <stopargument>c:\nginx</stopargument>
  <stopargument>-s</stopargument>
  <stopargument>stop</stopargument>
</service>
已記錄
 

SimplePortal Classic 2.0.5