14

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?

p.campbell
  • 4,397
  • 6
  • 40
  • 51
Deleted
  • 1,832
  • 7
  • 23
  • 31
  • 9
    I would name it lightningfastlowonfeaturessecurewebserverforlinux. Not sure if that name would catch on though. – Dominic Rodger May 13 '09 at 13:14
  • I think they thought of that too, but they settled with `nginx'. –  May 13 '09 at 13:24
  • You could always use python: " python -m SimpleHTTPServer " this will server the current directory on port 8000. – Gert M May 14 '09 at 06:46

16 Answers16

29

nginx Learn more at the nginx wiki site.

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

p.campbell
  • 4,397
  • 6
  • 40
  • 51
17

Lighttpd comes to mind.

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

p.campbell
  • 4,397
  • 6
  • 40
  • 51
8

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

8

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

Philip Durbin
  • 1,541
  • 2
  • 15
  • 24
  • With Python-3 use [`$ python -m http.server 8000`](http://docs.python.org/3.3/library/http.server.html) – webwurst Oct 09 '13 at 13:59
5

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:

vartec
  • 6,137
  • 2
  • 32
  • 49
4

Several commenters have mentioned lighttpd. Another option is thttpd.

4

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

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

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.

chiggsy
  • 1,576
  • 1
  • 15
  • 20
3

or kHTTPd - the server built into the linux kernel ?

  • 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. –  May 13 '09 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. –  May 13 '09 at 13:40
  • 5
    However, as of kernel 2.6, it's not built into the kernel any more. – MarkR Jun 01 '09 at 12:24
2

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.

Alister Bulman
  • 1,624
  • 13
  • 13
2

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.

pQd
  • 29,561
  • 5
  • 64
  • 106
1

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.

joschi
  • 20,747
  • 3
  • 46
  • 50
1

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

1

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

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

Brad Gilbert
  • 2,473
  • 2
  • 21
  • 19
0

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.

bintut
  • 304
  • 1
  • 5