4

I'm looking for a good way to run LightTPD as a service on a Windows server, but all the solutions I can find are either general-purpose shareware or quite complicated to set up.

Is there any good and easy way to accomplish this?

damd
  • 279

2 Answers2

0

I don't know why this is on stack overflow, but to summarize:

There's a free tool called RunAsService. With it, you should be able to configure a .bat or other executable to be launched as a service.

Darth Android
  • 38,658
0

You can use winsw, a free (as in both freedom and beer) utility to run Lighttpd or any other program (Nginx, PHP-CGI, etc) as a service.

Download the winsw binary, rename it to winsw and put it in your Lighttpd root directory where your lighttpd.exe resides, and create a winsw.xml file in there with the following contents :

<service>
    <id>lighttpd</id>
    <name>LigHTTPd</name>
    <description>Lighttpd web server.</description>
    <executable>lighttpd</executable>
    <workingdirectory>C:\Lighttpd\</workingdirectory>
    <logmode>append</logmode>
</service>

Of course, adjust the paths as necessary if your Lighttpd lives somewhere else.

Finally, open an elevated (as an administrator) command prompt and issue the following commands : winsw install (that will register the service and set it to start automatically each boot) and winsw start to start the installed service right away.

Of course feel free to change the service's auto start settings in services.msc.