Chinaunix首页 | 论坛 | 博客
  • 博客访问: 26140533
  • 博文数量: 2065
  • 博客积分: 10377
  • 博客等级: 上将
  • 技术积分: 21525
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-04 17:50
文章分类

全部博文(2065)

文章存档

2012年(2)

2011年(19)

2010年(1160)

2009年(969)

2008年(153)

分类: 系统运维

2010-05-20 22:03:35

NginxWINDOW平台制作系统服务

时间:2010-5-20,整理人:遥方

1、  下载微软服务注册工具srvany.exe, instsrv.exe, 存放到D:\nginx\目录下

2、  安装NGINX服务, 将命令行切换到D\nginx\,执行下列命令

打开CMD窗口切换到D:\nginx目录下面去

instsrv NGINX D:\nginx\srvany.exe            执行这个命令

 

D:\nginx-0.8.12>instsrv.exe NGINX D:\nginx-0.8.12\srvany.exe

 

The service was successfuly added!            服务添加成功!

 

Make sure that you go into the Control Panel and use

the Services applet to change the Account Name and

Password that this newly installed service will use

for its Security Context.

 

3、  D:\nginx\,编辑一个nginx.reg文件

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NGINX\Parameters]

"Application"="D:\\nginx-0.8.12\\nginx.exe" 

"AppParameters"=""

"AppDirectory"="D:\\nginx-0.8.12\\"

 

4、  让服务与程序关联起来, 命令行执行

regedit /s nginx.reg

 

5、  编辑启动nginx脚本start-nginx.bat(关闭脚本不用变), 让程序以服务方式运行

D:\nginx-0.8.12>net start nginx                   以后就可以这样来启动nginx服务了。非常方便哦!

 

 

结论:将nginx配置成系统服务。再打开任务管理器发现这个时候运行nginx的用户为System

阅读(799) | 评论(0) | 转发(0) |
0

上一篇:Resin路径与JSP路径

下一篇:配置主机头

给主人留下些什么吧!~~