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?

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState