windows 将nginx程序修改为服务运行

1,下载nginx,http://nginx.org/en/download.html, 放在c盘  c:/nginx1.10.3

2,下载nssm,https://nssm.cc/,解压后进入相对应的操作系统位数(32位或64位)的文件夹


10005995-604da5534b8d7d79.png

3,在nssm-2.24/win64路径下运行命令行(若运行nginx,建议先退出)

nssm.exe install nginx

4,在弹出的操作框中操作:

    1> Application 标签页的Path输入框输入nginx程序路径,c:/nginx1.10.3/nginx.exe

    2> Application 标签页的Startup directory 输入  c:/nginx1.10.3

    3> I/O 标签页的 Input(stdin) 输入 start nginx

    4> I/O 标签页的 Output(stdout) 输入 c:/nginx1.10.3/logs/service.out.log

    5> I/O 标签页的 Error(stderr) 输入 c:/nginx1.10.3/logs/service.err.log

扫描二维码关注公众号,回复: 6440999 查看本文章

    6> 点击Install service

5,打开服务窗口,启动nginx服务


参考链接:

https://stackoverflow.com/questions/40846356/run-nginx-as-windows-service

转载于:https://www.jianshu.com/p/8a499b44d743

猜你喜欢

转载自blog.csdn.net/weixin_34355715/article/details/91056022