Porting of BOA Web server under embedded Linux

Source: Internet
Author: User

*************************************************************************************************************** ************
Easywave Time: 2014.09.28

Category: Linux applications-Web server Boa WebServer Disclaimer: Reproduced, please keep the link

Note: If there is an error, please correct me. These are the journal articles I studied ...

*************************************************************************************************************** ************

A: About BOA webserver

BOA webserver is a single-tasking HTTP server, unlike other Web servers, when a connection request arrives, it is neither a separate process for each connection, nor a multi-link with the process of copying itself. Instead, the HTTP request list is created to handle multiple HTTP connection requests, and it only creates new abbreviations for CGI programs, maximizing system resources, which is important for resource-constrained embedded systems, and it automatically generates directories, automatically unzip files, and so on. So Boa has high HTTP request processing speed and efficiency, application in the embedded system has a high value, and if you want to support ASP, the ASP service components need to be ported to the BOA, I saw a router made a custom ASP server. If your friends are interested in porting ASP to Boa, there is no detailed introduction to ASP porting.


II: The function of BOA webserver

The capabilities of the embedded Web server Boa include receiving client requests, parsing requests, responding to requests, returning the results of request processing to the client, and so on, with the following workflow:

    • Fix the root directory of the BOA webserver server
    • Read configuration file (boa.conf)
    • Write log file
    • Initialize the Web server, including creating environment variables, creating TCP sockets, binding ports, starting listening, entering a looping structure, and waiting for and receiving client connection requests
    • When a client connection request arrives, the Web server is responsible for receiving the client request and saving the relevant request information
    • After receiving a connection request from the client, the Web server parses the client request, resolves the requested method, URL target, optional query information, and form information, and handles the request according to the client.
    • After the Web server processes the client's request, sends a response message to the client and finally closes the TCP connection to the client


Three: BOA webserver official website

As shown in the following:


BOA webserver website: http://www.boa.org/, but has not been updated for a long time, but for the embedded Web server has enough.


IV: The transplant of BOA webserver

First, let's look at the directory architecture of the Boa webserver, as shown in:


Note that the directory that needs to be looked closely is the SRC directory, and the main structure of the SRC directory is as follows:


Before you configure the Boa webserver, you need to modify a few places to be able to, otherwise it will not compile, and error, first need to check whether the host PC Linux installed Bison and flex, if not installed, use the following command to install, as follows:

sudo apt-get install Bison
sudo apt-get install Flex

Next need to modify the place is server_root, see if there is a macro definition, if there is no need to modify it, how not to modify it just fine, this is because the boa.conf file must be placed in the Server_root directory, that is, the/etc/boa/directory, as follows:


As you can see, server_root is defined and is defined in the Defines.h file, so there is no need to modify the code. Next is the configuration file modification, mainly modifies the makefile file, but here I modify the SRC directory under the makefile.in file, I here the changes are as follows:


Note that the red selected parts need to be modified, after modifying the makefile.in file, you can compile, I use a build.sh script to run the compilation, the script is as follows:


Note that this $install_path can be defined by itself, such as:

Install_path= ' pwd '/_install

Mkdir-p $INSTALL _path


After running the./build.sh command, check to see if it has stripped through file boa and file Boa_indexer!!! To this point has been compiled OK, as to how to configure the BOA please go to the network to search it, here is not detailed description.

Porting of BOA Web server under embedded Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.