qshttpd

Lightweight http server

News

Jul 25, 2007: Version 0.3.0 is out. It adds support for 206 Partial Content a.k.a. HTTP resume, one of the features really needed to use qshttpd for serving big files.

Jul 24, 2007: Version 0.2.1 (bugfix) released. There was a design problem manifesting when serving large files. Because they were first loaded in a buffer and then served, you got huge response times, a lot of HDD activity and very high memory usage (file's size + 2MB). This went unnoticed because I tested qshttpd just with small files... until today. It was quite a surprise to see a memory usage of about 700 MB when downloading an iso file. Anyway, fixed now, the file is buffered in chunks of 1MB.

Jul 3, 2007: Version 0.2.0 released. Changes: BIG security improvements - chroot and dropping permissions/changing user. Reorganized the source file to use several small functions instead of one big main(). Posibility to set port, charset, user and group in the config file.

About qshttpd

qshttpd (quick & simple http daemon) is an extremly light and easy to configure http daemon. It implements a small part of the RFC 2616 (HTTP/1.1 specifications), mostly the GET request (with resume support) and some basic error reporting. In plain english, this means you can use qshttpd to host static sites, or just static content, such as images. The memory footprint is less than 3MB in size. When benchmarking with Apache Benchmark, the cpu usage of ab is higher than qshttpd's. It serves 1000 requests, with a concurency level of 100 in 6 seconds on a Celeron @ 466 MHz with 256 MB RAM.

It is released under the GPL license.

Use qshttpd

At the moment, qshttpd is under heavy development and it is not tested too much. Starting from version 0.2.0, it chroots and drops permissions, so even if there are security bugs (I hope there aren't) your server should be OK, just backup your www root.

If you intend to use qshttpd for serving static content and you are using Apache, maybe mod_proxy is going to help you.

To use it, download it from here. Try first the precompiled version, if it isn't working, compile it by running gcc ./qshttpd.c -o /usr/bin/qshttpd. Copy 404.html to the webserver root, modify qshttpd.conf (if needed) and then copy it to /etc/. Start qshttpd using the qshttpd command.

Contact

If you want to contact me regarding qshttpd, send an email at qshttpd (AT) linux-geek (DOT) org.