Boa: an Embedded Web Server
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.
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 http://www.boa.org/.
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 http://www.uclinux.net/.
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.
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.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Linux Systems Administrator
- New Products
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Have you tried Boxen? It's a
1 hour 48 min ago - seo services in india
6 hours 20 min ago - For KDE install kio-mtp
6 hours 20 min ago - Evernote is much more...
8 hours 20 min ago - Reply to comment | Linux Journal
17 hours 6 min ago - Dynamic DNS
17 hours 40 min ago - Reply to comment | Linux Journal
18 hours 38 min ago - Reply to comment | Linux Journal
19 hours 29 min ago - Not free anymore
23 hours 31 min ago - Great
1 day 3 hours ago



Comments
web server
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. http://blog.concordsupplies.com
web server
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. http://blog.concordsupplies.com
printer toner
toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,toner,
Apache embedded webserver
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
Is it possible to have a cgi as a directory index?