Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
1  
I actually ended up using ServiceRunner which basically does the same thing. This is the batch file that I had to use -- the /D parameter states the working directory for the command, which was apparently very important for it to work at all! –  damd Oct 22 '12 at 15:16

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.