Linux Lightweight Web Server 1th/2 page _linux

Source: Internet
Author: User
Tags litespeed reserved small web server java web in python

A dedicated HTTP application that complements Apache and other market-leading products

!--START RESERVED for FUTURE the use INCLUDE files--> the!--this cont ENT is automatically generated across all content areas--> "!--end RESERVED for FUTURE use INCLUDE Files-->


Level: Intermediate Cameron Laird (, vice President, Phaseit, inc.2007 year July 23

In recent years, there have been many interesting Web server implementations in the marketplace, including LIGHTHTTPD, Litespeed, and mongrel. These WEB servers claim to combine performance, manageability, portability, security, and other related values. The following engineering research will investigate lightweight Web servers to help you choose the Web server that is most likely to meet the technical requirements of the next project.

Lightweight WEB servers, such as, lighthttpd litespeed and mongrel , can bring a lot of benefits to your project. This article investigates this possibility and demonstrates the applicability of these WEB servers.

What does a WEB server need?

The first important aspect is a clear understanding of the areas surveyed (see Resources for more detailed information). The basic action of end users on the Internet is to "go to a Web page." From a large point of view, this involves collaboration between two applications:

    • A Web browser, such as Firefox or Internet Explorer, that requests a specific page and displays what is received from another application in a human-readable way.
    • A WEB server, usually on a remote machine, is responsible for responding to page requests, returning HTML-encoded or similar data streams.

All WEB users interact directly with the browser, so their choices and analysis are somewhat feverish accordingly. The server is visible only to the technicians of the site. According to Netcraft's recent survey, although there are many different Web servers, two of these Web servers occupy a 90% share, both of which are Apache and Internet Information Server (IIS). They are highly tempered products and claim to have not only a wide range of internal technical characteristics, but also a number of supporting books, add, consultants, providers and so on. So, do they have a place worth rebuilding?

The answer is yes. Important metrics for evaluating a WEB server are:

    • Performance : How quickly does the response to a request take?
    • Scalability: Can the server continue to run reliably when many users access it at the same time?
    • Security : Whether the server performs only the actions it should perform. What kind of support does it provide for authenticated users and encrypted transmissions? Does its use make nearby applications or hosts more vulnerable?
    • Reliability : What is the failure mode and failure rate of the server?
    • Standard Compliance : Does the server comply with the relevant RFC?
    • Flexibility : Can the server be tuned to support heavier request loads, dynamic pages that need to be computed, or expensive authentication, and so on?
    • Platform Requirements : Which platforms can this server be used for? Does it have specific hardware requirements?
    • Ease of Management : is the server easy to set up and maintain? Is it compatible with organizational standards such as logging, auditing, costing, and so on?

Apache and IIS cannot do the best in so many standards at the same time. In theory, it is clear that the targeted products can surpass market-leading products in at least one to two of the above.

One interesting thing to investigate about lightweight Web servers is that the competition between them is far more than theoretical: Careful research shows that they have a lot to offer and, even in many common situations, they stick to their own style relative to Apache and IIS. While it is reasonable to assume that market leader products have been carefully optimized to effectively avoid being defeated in terms of performance (for example), many small competitors are faster because they provide simple static WEB page services. When you run your tests using these WEB servers, you feel as if you were driving a go-kart car on the track, and unknowingly overtook the Porsche and Viper cars. That's not all: Sometimes lightweight WEB servers can be an effective complement to those big-brother servers, not just competing with them. Even if you know you're going to use Apache, sometimes you can make the most of it by partnering with a lightweight partner. The best solution sometimes requires collaboration between two or more Web servers.

Back to the top of the page

The lightweight nature of WEB services

The focus of this survey on "lightweight" is actually a subjective quality, like "art" or "style." It usually means simple, easy to install, streamline, low demand, and robust-smaller and simpler than Apache and IIS, and of course, they have become extraordinarily complex in trying to satisfy a large number of markets. For this purpose, although Java WEB servers, Aolserver, and Zeus have fascinating portability and performance advantages, their complexity and size make it necessary to be shut out.

Lightweight WEB servers can be applied to situations where market leader products and other "heavyweight" servers are not competent. For example, the entire server can be packaged in one file. This means that developers can easily carry all the tools required by the production environment. Even if you are running Apache on a production server, you can still try new ideas in a hotel room with a lightweight WEB server that can be installed in just a few seconds. Also, because of the low requirements of lightweight WEB servers, it is possible to run smoothly on hosts that cannot afford IIS.

Single File packaging

Single File packaging
Apache needs to be careful to install many of the files scattered across multiple directories. By contrast, the following WEB server is packaged in an executable file. One of my employers, Phaseit, specializes in deployment and packaging, and we can make Apache installations look simpler than usual. But even if we do the best, Apache or IIS and lightweight WEB servers still have a big difference in space footprint: The former takes up a lot of space.

Small, lightweight Web servers can also run well on small, low-power hosts. In our company (phaseit--see Sidebar ), we run dedicated hardware on industrial computers in remote, poorly qualified, or less-configured environments. In these cases, it is a great advantage to be able to provide a Web page through an application that has very low processing power or disk space requirements. This means that our machines can avoid the overhead of Apache's development and processing capabilities and build web-based management consoles.

In a way, almost all lightweight WEB servers are open source. If we need a Web server-specific behavior, some of the Web servers outlined below are small, understandable, and easily enhanced, with only two exceptions. These Web servers provide excellent raw material for projects embedded in Web services, whether they are in special hardware or in a specific application designed to run on a general-purpose computer. They are also widely used in Web sites with traditional skins:

    • YouTube relies on LIGHTTPD to quickly deliver archived content, such as video;
    • cdserve Run "German woodworking machinery and Tools" CD;
    • Litespeed touted it in Twitter,,,,, SlashGear, The role of and other famous Web sites;
    • OpenSUSE, Rubyonrails, Markaboo and other famous sites rely on Mongrel;
    •,,, the Drudge, and other sites are used thttpd;
    • Wait a minute.

The following examples illustrate the lightweight use of lightweight servers by developers: In our company, we use specialized hardware to provide office phone solutions. It is based on customized software that runs in the form of a traditional linux® application. With just one additional file and a bit of init.d configuration, it's easy to add a powerful "Web console" that provides a management interface for hardware and software. End users can monitor and configure their computers from any browser without having to schedule specialized hardware connections or troubleshoot other complexities that are common when using "vertical" hardware.

Service-Oriented Architecture (SOA) is considered difficult to use. In our experience, at least some of the drawbacks of SOA hinder the use of WEB services. We use lightweight Web services to set up a fast SOA for demonstration purposes.

Lightweight servers can even be used to produce data centers, including the High-profile sites listed earlier. Very high performance sites will separate operations to maximize the use of caching, proxy and other technologies. For example, an Apache-based site might have an architecture that provides slow-changing pictures from a dedicated file system through a small Web server. What the end user sees is actually the output that Apache and one or more secondary WEB servers collaborate on, each of them acting in their own good roles. Such an arrangement can provide very fast results at very low computational cost.

Back to the top of the page

Means and purposes

Although lightweight WEB servers have a lot in common, they vary from one place to the other. Most lightweight WEB servers are written in C, but it turns out that some other implementation languages can also be used successfully to implement servers, which I've experimented with, including Erlang, Java, Lisp, Lua, Perl, Python, and TCL. If there is a language that you like, you might find a WEB server that works for you.

For a number of specific reasons, you may be looking at some "uncommon" language:

    • Teaching: Use a lightweight WEB server to develop an important, but not too large, goal. This is a good way to gain experience in using a language.
    • Although the lightweight Web server written in C is 10-50 KB, the more advanced languages have a KB to several MB run time, the source files for the entire WEB server may be only thousands of bytes. This WEB server takes up a small amount of space and is therefore easier to share with technology partners than Apache.
    • More advanced languages can make experiments more appealing-for example, adding a new http/1.1 feature can take only a few lines of source code. These lightweight servers are very handy for experimental materials.
    • Adding an HTTP server to an existing application written in a high-level language requires only a few more lines of source code.

Athana can serve as examples of these topics. It's a WEB server written in Python. It supports HTTP multiple portions (uploads), sessions, cookies, and so on. Starting with version 0.2.1, Athana has been written in a separate, carefully organized source file.

As mentioned earlier, different lightweight WEB servers have different advantages, which are more or less independent of the programming language. All lightweight WEB servers are smaller and easier to configure than Apache. Some lightweight WEB servers are faster and some are much faster than Apache. Others emphasize security, ease of load, scalability, or memory occupancy. In any case, these servers can be thoroughly understood in a way that does not apply to Apache.

What specific products make these possibilities a reality? Even if you only pay attention to "lightweight" servers, you face a very large collection of difficult products to manage. However, they can be divided by subclasses: ultralight, focus on security, support for a particular language type, and so on.

Current 1/2 page 12 Next read the full text

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.