Boa: an Embedded Web Server

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

Once you have the basics running, check out the config file (boa.conf) for additional configuration options. Here is a quick summary of the most important. The config file is well commented so if you don't see what you need here, read the comments for additional options.

  • Port allows you to specify the port to listen on. The default is 80, which is the standard HTTP port. For any port less than 1024 you must start Boa as root.

  • By default, Boa binds to all IP addresses. This means that any request that comes into the system on the specified port is served by Boa. If this isn't acceptable, you can use either the VirtualHost directive to point different requests to different files, or you can run individual copies of Boa for each IP address.

  • User and Group allow you to specify the name of the user and group Boa runs as. Normally you would start Boa as root, and then once it configures itself, it changes to run as the specified user and group.

  • ErrorLog and AccessLog allow you to specify where the log files are located. If you comment out the AccessLog line, no access log will be created.

  • DocumentRoot specifies the root directory of the HTML files.

  • UserDir specifies a directory name that can be appended onto a user's home directory to locate web pages accessed by using ~user in the URL.

  • DirectoryIndex specifies the name of the index file. This is traditionally index.html.

  • DirectoryMaker is the path to the program used to create index listings. Comment this out if you don't want to allow directory listings.

  • Alias is used to specify a redirect, allowing a specified URL to access a page in a different location. Multiple Alias directives are allowed.

  • ScriptAlias is used to specify where CGI scripts can reside. Essentially, this allows a shorthand in the URL for locating the scripts.

Conclusion

In order to test Boa I created two files: one HTML file (Listing 1) and a CGI script written as a shell script (Listing 2). Figure 1 shows what is displayed by the HTML script, and Figure 2 shows what is displayed by the CGI script. Note that I created these scripts using vi. If you would rather use an editor specifically designed for creating HTML, many are included with every Linux distribution. For example, KWebDev is one of the many included with KDE. WebMaker is another.

Listing 1. HTML Test Page

Listing 2. Shell Script to Test CGI

Figure 1. Screenshot of What the HTML Script Displays

Figure 2. Screenshot of What the CGI Script Displays

The only problems I encountered were mistakes on my part with configuration parameters and file locations. Once I got everything in the right place, Boa performed as expected. If you have the need for a web server in an embedded product, Boa offers a great choice.

Sid Wentworth prefers animals to people but also sees that computers can be his friend. He has over 20 years of experience working with computers, virtually all without involvement with Microsoft products. Sid can be reached at swentworth@hushmail.com.

______________________

Comments

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. http://blog.concordsupplies.com

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. http://blog.concordsupplies.com

printer toner

manoj's picture

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

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?

Webinar
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

Webinar
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