How to make the Nginx-0.7.54(Windows official release) RUN AS WINDOWS SERVICE?

Recently, I got Nginx-0.7.54(official Windows binary), it is simply to
install, I’m very apperciate it.

But in this version, Nginx must be started as

cd c:\nginx
start nginx

My question is how to make it run as a windows service?
Which is important for a server to start the nginx service before any
user is loggin on.

I used to achieve it as

cd /d c:\nginx
instsrv Nginx c:\nginx\srvany.exe

and add follow register information

Windows Registry Editor Version 5.00

“Application”=“C:\nginx\nginx.exe”
“AppParameters”=“”
“AppDirectory”=“C:\nginx\”

But these above doesn’t work in this version. I think the problem may be
lie in the difference of starting nginx. But I don’t have any more idea,
please help me, thx.

Posted at Nginx Forum:

On Sat, May 02, 2009 at 05:34:59AM -0400, kernelforce wrote:

“Application”=“C:\nginx\nginx.exe”
“AppParameters”=""
“AppDirectory”=“C:\nginx\”

But these above doesn’t work in this version. I think the problem may be lie in the difference of starting nginx. But I don’t have any more idea, please help me, thx.

Look in the event log and c:/nginx/logs/error.log.
As to service, I plan to add capabilty to rus as service without SrvAny.

On Sam 02.05.2009 17:47, Igor S. wrote:

On Sat, May 02, 2009 at 05:34:59AM -0400, kernelforce wrote:

Recently, I got Nginx-0.7.54(official Windows binary), it is simply
to install, I’m very apperciate it.

[snipp]

Look in the event log and c:/nginx/logs/error.log.
As to service, I plan to add capabilty to rus as service without
SrvAny.

Maybe also with IOCP :wink:

http://www.codeproject.com/KB/IP/iocp.aspx
http://www.codeproject.com/KB/IP/iocp_server_client.aspx

BR

Aleks

On Sat, May 02, 2009 at 05:44:26PM +0200, Aleksandar L. wrote:

SrvAny.

Maybe also with IOCP :wink:

Windows Sockets 2.0: Write Scalable Winsock Apps Using Completion Ports | Microsoft Learn
Writing Scalable Server Applications using IOCP - CodeProject
http://www.codeproject.com/KB/IP/iocp_server_client.aspx

IOCP requires another I/O concept: it’s requires asynchronous I/O
while select/kqueue/epoll/etc. require non-blocking I/O. However,
nginx was being developped with asynchronous I/O in mind, therefore
I will add single-thread IOCP soon. It should be more scaleble than
select() even with single thread. The second step, multithreaded IOCP,
is more complex since nginx workers are single thread applications,
and the step requires introdution various locks and mutexes.

I’m looking forward it!!!
You see, if it doesn’t run as service, when you log out the server, the
nginx would be terminated. T_T

Posted at Nginx Forum:

How about we all just forget about the windows version and concentrate
on making the linux version all the better.

Better yet, let forget windows even exists for anything internet
related!