14
votes

The list of must-have requirements:

  • be able to serve static HTML pages and files (images, compressed archives, ASCII text files etc) over HTTP.
  • be Resource conservative. It uses what's needed to send data over the network in form of memory and CPU, and not much more.
  • have a small install footprint.
  • use only as much network bandwith as is necessary.
  • be mature.
  • be easy to configure.
  • be compiled into native code. No Python or Java etc.

What I don't need:

  • Complex configuration options. If needed later on, I'll switch to Apache httpd.
  • Support for running CGI, Perl, PHP, Java, Server Side Includes or other "extras".

Any suggestions please?

3
  • 9
    I would name it lightningfastlowonfeaturessecurewebserverforlinux. Not sure if that name would catch on though. May 13, 2009 at 13:14
  • I think they thought of that too, but they settled with `nginx'.
    – alamar
    May 13, 2009 at 13:24
  • You could always use python: " python -m SimpleHTTPServer " this will server the current directory on port 8000.
    – Gert M
    May 14, 2009 at 6:46

16 Answers 16

29
votes

nginx Learn more at the nginx wiki site.

It's hot, fast, small. A few % on the Netcraft survey.

1
  • I agree. For static pages nginx is brilliant!
    – LukeP
    Oct 24, 2011 at 14:44
17
votes

Lighttpd comes to mind.

According to the Lighttpd tutorial docs, configuring a static server takes about 5 minutes:

1
  • The config files have a terrible syntax IMHO.
    – DanMan
    Nov 23, 2012 at 12:14
8
votes

There are lots but I personally like Cherokee. It's relatively new but also very simple to configure with a built-in web-gui.

1
  • is it still valid?
    – BigSack
    Aug 22, 2013 at 19:30
8
votes

Maybe I'll get downvoted because these solution are not compiled into native code per the question's "must have" list, but for static content it doesn't get much easier than sharing up the current directory with a Python one liner:

python -m SimpleHTTPServer 9914

Note that port 9914 is arbitrary and simply the example used where I found this solution: http://linux.byexamples.com/archives/506/python-simple-http-server-for-file-sharing

Naturally, you can also do this with Perl:

perl -MIO::All -e 'io(":8080")->fork->accept->(sub { $_[0] < io(-x $1 ? "./$1 |" : $1) if /^GET \/(.*) / })'

. . . as described at http://search.cpan.org/~ingy/IO-All-0.39/lib/IO/All.pod#A_Tiny_Web_Server

1
5
votes

The server which is exactly what you described:

  • kHTTPd — in kernel, very simple server. Only static files.

Blazing fast servers, that also can serve dynamic pages if needed:

4
votes

Several commenters have mentioned lighttpd. Another option is thttpd.

2
  • 1
    looks good, is that what Wile E Coyote uses? ;)
    – Kenny
    May 13, 2009 at 13:24
  • Is this still alive? The last release was in Dec of 03 and the mailing list archive stops in May of 08
    – JonDrnek
    Jun 29, 2009 at 17:37
4
votes

Fast, secure, efficient, low features: publicfile by Dan Bernstein.

1
  • We use publicfile in several places, including for simple tasks like internal WPAD configuration file distribution. Very fast, very simple, always works. Dec 10, 2012 at 15:43
3
votes

or kHTTPd - the server built into the linux kernel ?

3
  • First thing that popped into my mind. I haven't used it, but I've seen the option there every time I'm configuring a kernel.
    – Adam Jaskiewicz
    May 13, 2009 at 13:35
  • BTW, from the web site, "As of kernel 2.3.14, kHTTPd is integrated into the kernel." So it's been around the block a few times.
    – Adam Jaskiewicz
    May 13, 2009 at 13:40
  • 5
    However, as of kernel 2.6, it's not built into the kernel any more.
    – MarkR
    Jun 1, 2009 at 12:24
3
votes

I'd go with Cherokee here. Also, I'd forget about Apache. We all grew up, fondly, using apache, having fun with it, and mysql. We all have great memories, and we all know how to use it. :)

That, however is the past, tinted through rose coloured glasses. Fat ass memory usage, fat processes, complex configuration files, embedded interpreters.. feh. In today's age of VPS's nobody needs fat ass apache anymore. Love the memories, but save your RAM for your apps.

2
votes

i've been using mathopd for last 2 years for serving static content [ mix of images on some e-commerce site + couple of large downloads ]. no headaches - easy to configure, just works and leaves cpu next to idle.

2
votes

I've had excellent results for years with thttpd, frequently serving 250+ requests per second (and that was averaged over the course of an hour), and as many as 400 simultanous requests. The memory use is low, stability extremely high and system load is almost nothing, even at a high req/sec load.

Bloom County's Bill the Cat, explains how to pronounce thttpd.

1
vote

You might want to have a look at http://www.lighttpd.net/. Am not sure if its an overkill for your requirements.

1
vote

There is a commercial web server called Zeus that is quite widely used in content industries characterised by high-volume static content. IIRC it is based on async. I/O, which is very efficient on CPU. It might do what you want, but it is not free.

1
vote

You could try okws.

OKWS is a Web server, specialized for building fast and secure Web services. It provides Web developers with a small set of tools that has proved powerful enough to build complex systems with limited effort. Despite its emphasis on security, OKWS shows performance advantages relative to popular competitors: when servicing fully dynamic, non-disk-bound database workloads, OKWS's throughput and responsiveness exceed that of Apache, Flash (the reigning king of Web server performance) and Haboob (an academic system reputed to be the fastest Java Web server on the block). Commercial experience with OKWS suggests that the system can reduce hardware and system management costs, while providing security guarantees absent in current systems.

copied from okws.org

1
vote

To be more or less complete, do not forget Hiawatha. The development on this one is quite active and it has a friendly and helpful community.

0
votes

Most of the secure and lightweight web servers were already mentioned (e.g. publicfile, Nginx, Cherokee, etc). If none of those will pass to your requirements, I think my suggestion is to host your static files (assets) to AWS S3 and CloudFront and Google Sites for your web pages.

Not the answer you're looking for? Browse other questions tagged .