Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
9  
I would name it lightningfastlowonfeaturessecurewebserverforlinux. Not sure if that name would catch on though. –  Dominic Rodger May 13 '09 at 13:14
    
@Dominic: LOL +1 –  Eduardo Molteni May 13 '09 at 13:16
    
I think they thought of that too, but they settled with `nginx'. –  alamar 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 6:46
add comment

closed as not a real question by Mark Henderson Jan 20 '12 at 8:54

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

16 Answers

up vote 29 down vote accepted

nginx Learn more at the nginx wiki site.

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

share|improve this answer
    
I agree. For static pages nginx is brilliant! –  LukeP Oct 24 '11 at 14:44
add comment

Lighttpd comes to mind.

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

share|improve this answer
    
The config files have a terrible syntax IMHO. –  DanMan Nov 23 '12 at 12:14
add comment

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

share|improve this answer
    
is it still valid? –  BigSack Aug 22 '13 at 19:30
add comment

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

share|improve this answer
    
With Python-3 use $ python -m http.server 8000 –  webwurst Oct 9 '13 at 13:59
add comment

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:

share|improve this answer
add comment

Several commenters have mentioned lighttpd. Another option is thttpd.

share|improve this answer
1  
looks good, is that what Wile E Coyote uses? ;) –  Kenny May 13 '09 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 –  Jon Drnek Jun 29 '09 at 17:37
add comment

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

share|improve this answer
    
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
add comment

or kHTTPd - the server built into the linux kernel ?

share|improve this answer
    
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 '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. –  Adam Jaskiewicz May 13 '09 at 13:40
5  
However, as of kernel 2.6, it's not built into the kernel any more. –  MarkR Jun 1 '09 at 12:24
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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