Boa: an Embedded Web Server
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.
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 2. Shell Script to Test CGI
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.
email: swenthworth@hushmail.com
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
| 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 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- Roll your own dynamic dns
2 hours 22 min ago - Please correct the URL for Salt Stack's web site
5 hours 33 min ago - Android is Linux -- why no better inter-operation
7 hours 49 min ago - Connecting Android device to desktop Linux via USB
8 hours 17 min ago - Find new cell phone and tablet pc
9 hours 15 min ago - Epistle
10 hours 44 min ago - Automatically updating Guest Additions
11 hours 53 min ago - I like your topic on android
12 hours 39 min ago - This is the easiest tutorial
19 hours 15 min ago - Ahh, the Koolaid.
1 day 53 min 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?