Boa: an Embedded Web Server

Sid takes a look at Boa, a web server suitable for embedded systems.

Most of the world thinks of a web server as something on the Internet that can help find a football score, access a bank account or find an airplane flight. That's well and good but, in the embedded world, there are lots of places where a web server could come in handy. A common example is a network-connected printer. Being able to inquire about the status of the printer is useful, and if a small enough web server is available, it could offer a convenient interface.

This isn't just theory. Tektronics, for example, includes a web server in its 780 color laser printer. Their server allows you to configure the printer, access documentation, inquire about printer status--including toner levels--and includes links for ordering supplies. I am sure the cost of the web server is offset by supplies revenue and decreased support costs.

The most popular web server for traditional web sites is Apache. Apache is full-featured, very configurable and very reliable. It has proven itself in the general-purpose web server market and has been adopted by major players, including IBM.

Apache's design requires it to spawn (fork and exec) a separate task for each simultaneous connection. This is not necessarily a bad design, but in the embedded world, it is likely that you will need something that uses fewer resources--an average memory footprint in the tens of thousands of bytes rather than in the megabytes, for example.

Enter Boa

Boa is a tiny web server that also offers extremely high performance. It is specifically designed to run on UNIX-like systems, which includes Linux, as well as the *BSD systems. To get all the legal stuff out of the way, Boa is available for free and is covered by the GNU Public License (GPL). The source code for Boa, as well as documentation, can be found at

The following point taken from the Boa web site shows why I have decided to write about Boa:

Boa currently seems to be the favorite web server in the embedded crowd, and embedded Linux, despite all the marketing hype, really is a big deal. Supposedly, an older version of Boa, v0.92q, runs in 32K address space on m68k, like used in uClinux. See

Unlike traditional web servers, Boa is single-tasking. What this means is that it internally multiplexes all of the ongoing HTTP connections rather than the more traditional forking of multiple copies for each connection. It must, of course, fork separate processes to execute CGI scripts, but that is well defined and under the control of the system designer.

My use of Boa has been to handle very low-volume HTTP connections on the order of a few hundred to a few thousand pages served per day. The Boa web page, however, claims that tests show Boa capable of handling several thousand hits per second on a 300MHz Pentium and dozens of hits per second on a 20MHz 386/SX. Thus, for most applications, it's unlikely that performance is going to be an issue.

Of course, in an embedded application, it is likely that the primary job of the processor will be handling something other than running a web server. What this means is that running Boa is not likely to significantly decrease the resources available for the primary purpose of the embedded CPU.

This small size and high performance doesn't come for free. However, what Boa doesn't do generally woudn't be missed for an embedded system. Here is the short list:

  • The REMOTE_HOSTNAME environment variable is not set. What this means is that a CGI program doesn't have the name of the accessing host available. The REMOTE_ADDR variable is available, so if the CGI program actually cares, it can do its own lookup.

  • Boa does not support server-side includes. SSI is slow because the text of each requested document must be searched for each request.

  • The ability to change root directories (chroot) is not available.

  • Rather than offering access control features, Boa just uses Linux/UNIX filesystem permissions to determine what can be served. This is generally not a problem as Boa can be configured to run as any user ID you desire.

Setting up Boa

Because Boa is so compact, it is also very easy to install and configure. The details are on the Boa web site, but if you are familiar with installing typical tarballs, Boa will be no surprise. The basic steps are:

  • Download the software.

  • Unpack using tar xvzf.

  • Optionally edit the defines.h file in the src directory to change the default SERVER_ROOT. This isn't mandatory; you can also specify the server root on the command line when you start Boa.

  • Run the configure script (./configure) and then type make to build the executable. Recently, I built Boa on my laptop. The make step took less than 11 seconds.

  • Edit the configuration file, boa.conf, to set up your local configuration.

  • Make sure the appropriate directories (such as the log directory) exist and have the proper permissions.

  • Start Boa from the command line. Use the -c command-line option to specify the server root if you didn't set SERVER_ROOT to the desired directory location in define.h.

That's it. You should have a working version of Boa. Point your web browser at it and see what happens. If it doesn't work, check the error_log file.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

web server

kara Jones's picture

This would be great site for me.I really admire you Sid because you admit your mistakes and also you offer us good choice.Your 20 years of experiencing working in computer is a good advantage to you.Good luck and more power.....

Kara Jones
Great printer toner and ink cartridge deals, discounts and coupons. Also, check out the latest printer reviews and technology news.

web server

kara Jones's picture

This would be great site for me.I really admire you Sid because you admit your mistakes and also you offer us good choice.Your 20 years of experiencing working in computer is a good advantage to you.Good luck and more power.....

Kara Jones
Great printer toner and ink cartridge deals, discounts and coupons. Also, check out the latest printer reviews and technology news.

printer toner

manoj's picture


Apache embedded webserver

Davide Cantaluppi's picture

Boa is a really good webserver but it doesn't offers all the options and the modules of an apache webserver, so who says apache can't be embedded?, I have done it with, foXServe a software platform for fox LX 832 SBC. I have also ported mod_ssl for cryptographt, mod_dav for mounting it as a web drive and PHP for pre-processing so a full mini server in just 66mmx72mm and with a lot more then BOA!!! Apache 1.3.x if right configured is not bigger than BOA. Consider also that Apache architecture is more scalable than BOA and can support more connections if fine tuned!

A cgi as DrectoryIndex

Antonio's picture

Is it possible to have a cgi as a directory index?

One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix