Embedded Development Web Server---boa porting

Source: Internet
Author: User

In the near period of time in doing ti8148 codec and related to the BOA Web server porting. In the process of porting to the arm Development Board, there are many problems encountered. The original thttpd due to function without boa perfect, such as Ubuntu under the Utf-8 encoded Web page in THTTPD to the client browser is the default iOS Europe garbled, but the boa display normal, killed

The porting steps are now organized as follows: (which involves personal habits and routing problems, depending on the situation)

1. Download the source code:

Download URL http://www.boa.org/boa-0.94.13.tar.gz, but actually download the package for Boa-0.94.13.tar.tar

2. Unzip the source package:

Copy the source code to the/USR/SRC directory,

#tar-XVF Boa-0.94.13.tar.tar

After that, the boa-0.94.13 directory is generated under the/USR/SRC directory.

3. Modify the source code:

① Modify the BOA.C source file in the Boa-0.94.13/src directory, about 225 lines, comment out the following statement:

if (setuid (0)! =-1) {

Die ("Icky Linux kernel bug!");

}

The specific reason for the comment has not been understood! Being studied ... You cannot use the Post method without commenting.

② Modify the Compat.h header file in the BOA-0.94.13/SRC directory, approximately 120 lines, and modify the following:

#去掉即可 the # in Foo##->tm_gmtoff, or it will appear at compile time:

Util.c:100:1:error:pasting "T" and "-" does not give a valid prearocessing token.

This may be due to the use of a higher version of the compiler.

4. Execution Configure:

Execute configure under the BOA-0.94.13/SRC directory:

#./configure

The makefile file is then generated

5. Modify the Makefile file:

Modify the makefile file in the BOA-0.94.13/SRC directory, as follows: (provided that the cross-compilation toolchain is configured)

Modify CC = GCC to CC=ARM-LINUX-GCC

Modify CPP = GCC-E to CPP=ARM-LINUX-GCC-E

6. Execute Make:

Execute make in the BOA-0.94.13/SRC directory:

#make

The BOA executable is then generated in the BOA-0.94.13/SRC directory, which is a program that can be run on the arm board.

Bison flex may appear without installation

sudo apt-get install Bison Flex is available

If you do not install Bison and flex, the following error will occur when compiling boa

MAKE:YACC: Command not found

Make: * * [Y.TAB.C] Error 127

Make:lex: Command not found

Make: * * [LEX.YY.C] Error 127

7. Create the execution directory on the Development Board:

#mkdir/var/www (if you have one, omit it)

#mkdir/var/www/cgi-bin

#mkdir/var/log

#mkdir/var/log/boa

#mkdir/etc/boa

Copy the boa.conf file under the boa-0.94.13/directory to the/etc/boa directory of the Development Board;

Copy the/etc/mime.types files from the host to the Development Board/etc directory; (the resource type of the browser media) http://www.cnblogs.com/jsean/articles/1610265.html

Copy the BOA under the BOA-0.94.13/SRC directory to the Development Board/bin directory (or other default system path);

8. Modify the boa.conf file:

① Modify Line 48: User Nobody is User root

② modified 193 Line: scriptalias/cgi-bin//usr/lib/cgi-bin/for scriptalias/cgi-bin//var/www/cgi-bin/

9. Optimize Boa

  

Optimization:

#arm-linux-strip Boa

The optimization here is to remove the debug information from the BOA. After this operation, the BOA will be changed from 232K to about 62K, this optimization is more commonly used practice.

So far, boa transplant is complete.

10. There are a lot of problems when you start Boa after you kill thttpd.

Looking for a long time did not find thttpd startup settings script, simply put etc/under the thttpd renamed to THTTPD_BK, did not find boot started

[Email protected]:/opt/dvr_rdk/ti814x#./boa
. gethostbyname:: Resource temporarily unavailable

Solve:

Boa needs to build a boa directory in/etc, the main configuration file of the Boa Boa.conf,boa source has an example boa.conf, can be modified on its basis, the main changes are as follows:

Group Nogroup modified to group 0

scriptalias/cgi-bin//usr/lib/cgi-bin/modified to scriptalias/cgi-bin//var/www/cgi-bin/

#ServerName Www.your.org.here Remove the comment "#" From this line, the URL can be arbitrary. If you do not remove the comment from this line, the following error appears:

GetHostByName:: Resource temporarily unavailable error.

[Email protected]:/opt/dvr_rdk/ti814x#./boa

[15/mar/2011:02:29:06 +0000] log.c:73-unable to dup2 the error Log:bad file descriptor

Solve:

Under the Var/log mkdir boa;chmod 777 boa

Mount the/var/log/boa on the Ramfs file system before running Boa to make it writable

Note the WWW directory under the cig-bin CGI file is valid, invalid in the WWW directory, resulting in the direct download of CGI files, CGI files need to give 777 permissions, and a single file compilation to add static

At this point my boa can run up!

Ret=fwrite (&decoder_param,1,sizeof (System_param), p_fd); cause 502 Bad Gateway

Appendix:

http://blog.csdn.net/bull_liu/article/details/7486298

Http://www.cnblogs.com/zhangchaoyang/articles/1934386.html

Http://wenku.baidu.com/view/61c2f5addd3383c4bb4cd2a1.html

Http://www.cnblogs.com/jsean/articles/1610265.html

http://ubuntu828.blog.163.com/blog/static/174441561201110191250561/

http://bbs.csdn.net/topics/340022620

Embedded Development Web Server---boa porting

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.