I accidentally saw several small and interesting Web server programs and thought it was necessary to share them so that everyone could have more interesting choices besides Apache and IIS. This article mainly introduces the following small and easy-to-use httpd: micro_httpd, mini_httpd, thttpd, Lighttpd, and SHTTPD.
[Micro_httpd-really small HTTP server]
Features:
* Supports High-Level directory filtering.
* Supports common MIME types
* Supports Simple directories.
* Directory list supported
* Index.html can be used as the homepage.
* Trailing-slash redirection
* The total code of the program is more than 200 lines.
This httpd is suitable for Learning simple web server compiling and learning, because it only has a simple framework that can only process simple static pages and can be considered for static pages.
Official Address: http://www.acme.com/software/micro_httpd/
: Http://www.acme.com/software/micro_httpd/micro_httpd_12dec2005.tar.gz
[Mini_httpd-Small HTTP server]
Features:
* The get, Head, and post methods are supported.
* CGI functions supported
* Supports basic verification functions.
* Supports security. The upper-level directory Function
* Supports common MIME types
* Supports the directory list function.
* Index.html, index.htm, and index. cgi can be used as the homepage.
* Supports Virtual Hosts with multiple root directories
* Supports standard logging
* Custom error pages supported
* Trailing-slash redirection
Mini_httpd is also relatively suitable for learning and use. It implements a web server function and supports static pages and CGI. It can be used to place some simple things that are not suitable for production and use.
Official Address: http://www.acme.com/software/thttpd/
: Http://www.acme.com/software/mini_httpd/mini_httpd-1.19.tar.gz
[Thttpd-tiny/Turbo/throttling HTTP server]
Thttpd is a simple, small, lightweight, fast, and secure HTTP server.
Simple: it supports HTTP/1.1 protocol standards, or exceeds the minimum level
Small: it has very little run time because it does not Fork sub-processes to accept new requests, and very careful allocation of memory (performance comparison table: http://www.acme.com/software/thttpd/benchmarks.html)
Portable: it can run on most Unix-like systems, including FreeBSD, SunOS 4, Solaris 2, BSD/OS, Linux, and OSF.
Fast: It is faster than mainstream Web servers (Apache, NCSA, and Netscape). It is much faster under high load.
Security: it strives to protect the host from attacks without interrupting the server.
Similar to Lighttpd, thttpd does not use fork () for concurrent requests, but uses multiplex technology. Therefore, the performance is very good. At the same time, it also features a URL-based file traffic limit, which is very convenient for download traffic control. Like Apache, it must be implemented using plug-ins, which is less efficient than thttpd.
Similar to Lighttpd, Thttpd is suitable for static resource services, such as slice, resource files, and static html. It has good performance and is also suitable for simple CGI applications.
Official Address: http://www.acme.com/software/thttpd/
: Http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
[Lighttpd-light footprint + httpd = Lighttpd]
Lighttpd is an open-source software led by Germans. Its fundamental goal is to provide a secure, fast, compatible, and flexible web server environment for high-performance websites. It features low memory overhead, low CPU usage, good performance, and rich modules.
Lighttpd is one of the many opensource lightweight Web servers. It supports important functions such as FastCGI, CGI, auth, output compress, URL rewriting, and alias. Apache is popular because of its rich functions, many functions of Lighttpd are implemented accordingly. This is very important for Apache users, because these problems must be addressed when migrating to Lighttpd.
In practical use, Lighttpd is indeed very good. The main problem with Apache is the constant fork () and switching under intensive concurrency, as well as high (relative to Lighttpd) memory usage, make the system resources exhausted. Lighttpd uses the multiplex technology, the code is optimized, the size is very small, the resource usage is very low, and the response speed is quite fast.
The rewrite Technology of Apache is used to hand over heavy cgi/FastCGI tasks to Lighttpd. Taking full advantage of both, the load on that server is now reduced by an order of magnitude, the response speed has also increased by one or even two orders of magnitude!
Lighttpd is suitable for static resource services, such as slice, resource files, and static html. It has good performance and is also suitable for simple CGI applications.
Official Address: http://www.lighttpd.net/
: Http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz
[SHTTPD-simple httpd]
SHTTPD is another lightweight Web server with richer features than thttpd. It supports CGI, SSL, Cookie, MD5 authentication, and can be embedded into existing software. The most interesting thing is that no configuration file is required! Because SHTTPD can be embedded with other software, it is very easy to develop the web server of the embedded system. According to the official website, if SHTTPD uses uclibc/dielibc (simplified subset of libc) the overhead is very low.
Features:
* A small, fast, non-expandable, installation-free, and simple 40 kb EXE file can be run at will
* Supports get, post, head, put, delete, and other methods.
* Supports CGI, SSL, SSI, MD5 verification, resumed download, aliases, and inetd.
* Standard log format
* Very simple and clean embedded APIs
* Dietlibc friendly. not that friendly to the uclibc (*)
* Easy to customize and run on any platform: Windows, QNX, RTEMS, Unix (* BSD, Solaris, Linux)
Because SHTTPD can be easily embedded into other programs, SHTTPD is an ideal web server development prototype. developers can develop their own webserver Based on SHTTPD!
Http://shttpd.sourceforge.net/
: Http://jaist.dl.sourceforge.net/sourceforge/shttpd/shttpd-1.38.tar.gz