K
K
Kirill Firsov2011-03-09 19:12:33
Nginx
Kirill Firsov, 2011-03-09 19:12:33

How to add a windows service

Hello. Installed nginx on Windows XP, it is necessary that the command be
start D:\Webserver\nginx-0.9.5\nginx.exe
executed when the computer is turned on.
As far as I understand, you need to create a service =)

Answer the question

In order to leave comments, you need to log in

10 answer(s)
N
nd0ut, 2011-03-09
@nd0ut

Throw the command into a .bat file, then throw it into autoload.
A better shortcut to nginx.exe in autoload.

O
Ogra, 2011-03-09
@Ogra

support.microsoft.com/kb/137890

S
Sergey Savostin, 2011-03-09
@savostin

support.microsoft.com/kb/137890
support.microsoft.com/kb/251192
www.anvir.com/run-programs-as-services-2.htm (Russian version is free)

V
vanfukov, 2011-03-09
@vanfukov

Use InstallUtil.exe:
msdn.microsoft.com/en-us/library/50614e95.aspx

K
kekekeks, 2011-03-09
@kekekeks

In order for a program to run as a service, it must make some tricky API calls, which regular software usually doesn't. So use a banal autoload and don't reinvent the wheel.

B
BigD, 2011-03-09
@BigD

Native solution Instsrv + Srvany, as many have already written above. Works great for me with uTorrent.

D
den1n, 2011-03-10
@den1n

On the Internet, to create an Nginx service, they suggest using WinSW - projectkenai.com/projects/winsw/pages/Home
Parameters for creating a service for Nginx:

<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 c:\nginx</startargument>
<stopargument>-p c:\nginx -s stop</stopargument>
</service>

C
cjey, 2011-03-10
@cjey

The simplest solution is to create a task (Start-> Accessories->System Tools->Scheduled Tasks)
This task can be set to start at computer startup, and this task will run even if no one is logged in.

B
Backspace, 2011-03-10
@Backspace

sc create nginx binpath="D:\Webserver\nginx-0.9.5\nginx.exe" displayname="nginx" depend=Tcpip start=auto

Delete - sc.exe delete nginx
Well, and sc create /? if anything.

M
Mikhail Shevtsov, 2011-03-20
@mshewzov

Another option for working with services (deleting, creating, etc.) is through WMI. For example, here is the command to create a service: wmic service call create , where after create you need to enter the service parameters. Read more: wmic service call create /?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question