5

I'm looking for a dead simple web server for Windows. Load will not be high as it will be primarily serving binaries for a WPKG update service. It needs to serve the entire contents of a single folder over HTTP on a configurable (high) port. No CGI or other scripting is required, but it might be nice for future features.

I started with Mongoose, since it doesn't even have an installation requirement (a very nice perk), but it fails to start when run as a service. (Technically, it acts as it's own installer.) I've investigated LighTPD as well, but it appears to be minimally (at best) tested on Windows.

And naturally, I'm looking for something free. As in beer is good, but speech is better, as always.

Edit: I didn't mention this initially, but non-tech people will be doing the install. They'll have whatever script I write for the install, but the goal is a simple system that is easy to troubleshoot.

(I almost worded this question "What is the best...", but Serverfault rightly observed that that is a subjective question. And it's really not an optimization problem, any suitable solution will work. I just can't seem to find one for Windows.)

alficles
  • 153
  • 1
  • 6
  • What version of Windows? – Dave M Jun 01 '12 at 15:12
  • Server 2008, if I have to restrict it. It would be better to not need to care which version of Windows. (Bonus points if it works on (shudder) XP.) – alficles Jun 01 '12 at 15:22
  • 1
    This just screams for Apache. Out of the box, apache's conf doesn't even need to be touched and the footprint is small; IIS is going to require some script jiggery-pokery to get it to listen on a different port and if they happen to have IIS already, you're going to have to mess with virtual directories or adding a new site. – gravyface Jun 01 '12 at 16:22

5 Answers5

8

As others have stated, Apache is the clear choice here: flexible, well-tested on Windows (any "NT" version of Windows), for your application will require minimal configuration changes. Small footprint too. While Apache has rightly been criticized for a glut of configuration files, for simply dishing up some files, you would literally have to make one, maybe two changes to the default configuration:

Listen <your new port> and potentially: DocumentRoot c:\my\binary\path

Another aspect that you may not have considered is the binary signature and anti-virus: httpd.exe is a very common process, well-documented, open source; will not trigger false positives like perhaps a lesser known "freeware" Windows web server (Symantec uses it for their Endpoint Protection product to do exactly what you're doing: distributing update binaries to clients; I would think if it works for Symantec...).

Also, there's a built-in service install, all scriptable from the httpd executable (httpd -k install -n "MyServiceName" -f "c:\files\my.conf") so easy to "sidechain" from the parent installer. Easy to clean up/uninstall (again, httpd -k uninstall -n "MyServiceName").

More information here.

gravyface
  • 13,947
  • 16
  • 65
  • 100
4

There is Apache for Windows. I'm not sure how IIS would work, as it depends on licensing and your situation.

Is there anything else that appears when Googling for "windows free web server"?

Bart Silverstrim
  • 31,092
  • 9
  • 65
  • 87
  • Heh. Apache is large and complex. It's config files are a legendary pain in the tukas. I can fall back to it if I have to, but it drastically increases the maintenance cost for the system. – alficles Jun 01 '12 at 15:11
  • And yes, that search provides some options, but no experience and recommendations. http://en.wikipedia.org/wiki/Comparison_of_lightweight_web_servers is also a handy page. – alficles Jun 01 '12 at 15:13
  • Yes, but it works out-of-the box with the default configuration. Just install, run, and copy the files to the correct dir. You don't need to edit any config, to run a basic site with files. – mulaz Jun 01 '12 at 15:13
  • Even if you did have to edit the config, there's a lot of mindshare to Apache. I personally don't recommend running anything other than IIS on Windows because Apache is obviously a port not designed for it, but if you need help, it's out there. Most smaller packages may not have the user community to help with issues. – Bart Silverstrim Jun 01 '12 at 15:14
  • @alficles: "large and complex" -- sounds like you're reading the Lighttpd MO. Apache can be remarkably simple too. And if it's any consolation, Apache is exactly what Symantec uses for it's Endpoint Protection product's update distribution. – gravyface Jun 01 '12 at 16:15
  • "large and complex" is my experience running Apache under Linux for some time now. The Windows experience might be different (and I think I'm hearing that it is?), but surely the config files are the same. And those config files are a nest of vipers just waiting to bite you. Even simple stuff isn't simple in Apache because the defaults in the config files aren't what you expect. It's tolerable (even good, really) for a primary web server administered by a professional, but the troubleshooting area is *so* big when things go wrong. – alficles Jun 01 '12 at 16:21
  • 3
    @alficles: I think you're blowing this way out of proportion: you literally have to make one, maybe two changes: `DocumentRoot` to point to /your/binary/path, and then modify the `Listen` directive to change the port it listens on. All the other defaults will never need to be touched because you're not doing anything but serving up some binary files. If that's too overwhelming, I'm lost for words. – gravyface Jun 01 '12 at 16:31
  • Suggest changing question title to: *"How can I overcome my irrational fear of Apache?"* That said, I've been running Apache on ***all*** of my systems (Win, Lin, OSX, Solaris) for well over five years doing a variety of different things. My desktop runs a development instance with modules galore and a simple instance serving binary files on a configurable high port to my HTPC. (sound familiar?) It will get the job done with minimal fuss, and if you need it to do more in the future there's no need to migrate to a "more capable" server since it's already there. – Justin ᚅᚔᚈᚄᚒᚔ Jun 01 '12 at 18:09
  • Heh. Perhaps, "How can I overcome my longstanding aversion to the pain that is Apache?" :P You'll note that I accepted the other Apache answer. (The details for installing as a service were *super* helpful.) I decided to go with apache, though I suspect it will cause trouble in the long term for troubleshooting. It appears to be the best of the options. And at least it has a strong community. – alficles Jun 01 '12 at 18:25
  • @gravyface And there were *two* places I had to put my DocumentRoot. First, I had to update the DocumentRoot, then I had to change the spot that gives it permission to show an index page. That was unobvious, though ultimately doable. – alficles Jun 01 '12 at 18:28
  • 1
    @alficles thoughts and prayers go with you after your terrifying ordeal. – gravyface Jun 01 '12 at 18:34
4

Why not IIS with WebDAV enabled? Seems simple, and included with the OS?

http://learn.iis.net/page.aspx/350/installing-and-configuring-webdav-on-iis/

Brent Pabst
  • 6,059
  • 2
  • 23
  • 36
  • BTW, This solution is all point and click ;) – Brent Pabst Jun 01 '12 at 15:14
  • Yeah, it looks promising, though it looks like it requires an IIS install. The target machine is "probably" Server 2008, though it would be nice to be OS-version-agnostic. – alficles Jun 01 '12 at 15:20
  • WebDAV has been around for a while... here are some IIS 6 instructions: http://blogs.msdn.com/b/robert_mcmurray/archive/2008/03/04/enabling-webdav-on-iis-6.aspx. If you're looking for a client (Win7, XP) setup it most likely should work on Win 7, not sure about XP though. – Brent Pabst Jun 01 '12 at 15:40
  • It looks like IIS may come with Server 2008, but not other OSs (like Windows 7 Enterprise). That would greatly complicate install, but perhaps not fatally so. – alficles Jun 01 '12 at 15:41
  • I'm running IIS 7.5 on my Windows 7 Pro box. If pro can do it, Ent. certainly can. It also works on my Ultimate box, so I know enterprise can run it. If I recall the limitation is on the number of websites you can create and bindings, but don't hold me to that. – Brent Pabst Jun 01 '12 at 15:42
  • And here are the IIS client install instructions for Win7 http://digitizor.com/2009/02/20/how-to-install-microsoft-iis-server-on-windows-7/ – Brent Pabst Jun 01 '12 at 15:46
  • If installs are a problem... Looking at your requirements and comments, I can't imagine you're going to get much if you insist on 'lightweight/simple' AND 'runs as service' AND 'doesn't need to be installed'. I'd suggest something like tomcat, which is lightweight, IF you know that your target machines will have java installed (big ask, I know). As for IIS, that's present on just about any version of Windows (not sure about the "home" editions of the windows client) since Windows 2000. – Rob Moir Jun 01 '12 at 15:47
  • So, I had initially kinda discounted IIS because I was looking for simplicity of install and configuration. The links I'm seeing aren't giving me much hope, either. Is there something I'm missing, or does the process really involve "Install IIS", "Configure IIS", "Install WebDAV", "Configure WebDAV", "Create Web package", "Configure Web package" and so on? Compare to Mongoose (if it worked, natch): double-click the exe (next to a preconfigured config file). If desired, right-click the tray icon and choose "install as service". – alficles Jun 01 '12 at 15:47
  • I think you're blowing it out of proportion. The newer versions of IIS are modular, they tried the whole Apache route. So yes, you install it, enable WebDav and install a WebDav package which gives you full functionality. There isn't anything to configure on the IIS side, it just works and on WebDav the config is simply selecting the folders/files you wish to share. Doesn't get much easier than that. – Brent Pabst Jun 01 '12 at 15:51
  • @DJPon3 Yeah, the "AND" list is proving somewhat problematic. The "doesn't need to be installed" part could better be described as "can be installed by an only moderately technical user". Anything I can script the install of silently can fall under that. Scripting the install of IIS looks like it's a real pain. I might could manage a silent apache install, though, for example. – alficles Jun 01 '12 at 15:52
  • @BrentPabst I'll give it a go and see if it works ok. – alficles Jun 01 '12 at 15:53
  • I guess I was confused. You didn't mention you were going to have non-techs do the install. Maybe the better question is, why would you ever want a non-tech to install a web server given the huge security implications, scripted or not? – Brent Pabst Jun 01 '12 at 15:54
  • scripted IIS installs should be perfectly robust in themselves. The difficult bit would be the script you would want to run to determine which version of windows you are running and whether or not IIS is already installed, in order to make sure you then ran the correct IIS installer and config script. – Rob Moir Jun 01 '12 at 15:54
  • 1
    @BrentPabst Of course, one wouldn't *want* that. It's a matter of what one can get. If I got what I wanted (trained people in all the places they were needed), I'd be doing a lot of things differently. So, I'm looking for solutions that reduce the chances of people getting things wrong and reduce the number of things to troubleshoot when they do go wrong. Hence the desire for a simple system. – alficles Jun 01 '12 at 16:03
  • Out of curiosity, what's the update service you're using? – Brent Pabst Jun 01 '12 at 16:05
  • WPKG. (And some text to make my comment long enough. :) ) – alficles Jun 01 '12 at 16:06
  • Right, my bad. . – Brent Pabst Jun 01 '12 at 16:09
  • Well, I've got something up and running using point-and-click set up, though I'm having trouble getting it to serve "index.html" by default. – alficles Jun 01 '12 at 16:22
  • Hmm, can you connect to it from windows explorer though? You should be able to map a drive, run NET USE or just type in the URL to the address bar of the shell. – Brent Pabst Jun 01 '12 at 17:01
  • Yeah, it serves any page you ask for explicitly, but not the default document. After an hour of troubleshooting the default setup, I'm going to try Apache to see if it behaves better. – alficles Jun 01 '12 at 17:07
3

Apache? It's (I believe) still the most popular webserver around. And there's a windows version too, with a .msi installer, and works as a service.

mulaz
  • 10,472
  • 1
  • 30
  • 37
1

Abyss Web Server

It's free (personal users, low traffic sites, web developers, students, small companies, small intranets), you can change the port, and support CGI

Jorge Zuanon
  • 111
  • 5