加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

在windows下用winsw把nginx当成服务运行

发布时间:2020-12-13 21:14:04 所属栏目:Windows 来源:网络整理
导读:1. 下载winsw https://github.com/kohsuke/winsw/releases 2. 配置winsw.xml,把winsw放在nginx同一目录 configuration idnginx/id namenginx/name descriptionnginx/description executable%BASE%/nginx.exe/executable stopexecutable%BASE%/nginx.exe -s

1. 下载winsw

https://github.com/kohsuke/winsw/releases


2. 配置winsw.xml,把winsw放在nginx同一目录

<configuration>
  <id>nginx</id>
  <name>nginx</name>
  <description>nginx</description>
  <executable>%BASE%/nginx.exe</executable>
  <stopexecutable>%BASE%/nginx.exe -s stop</stopexecutable>
  <logpath>%BASE%/logs/</logpath>
  <logmode>roll</logmode>
  <depend></depend>
</configuration>
3.安装,以管理员身份启动cmd

winsw install

winsw uninstall //卸载

4.启动、关闭服务

net start nginx

net stop nginx

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读