OK6410 's Boa Server migration:
< a > Boa compilation
1. Download the latest version of the BOA server from www.boa.org: boa-0.94.13.tar.gz.
2. Unzip: Tar xzf boa-0.94.13.tar.gz
3. Enter the extracted folder boa-0.94.13 the internal src folder, make the following changes to the source file
=================================================
Because the ARM-LINUX-GCC compiler version is too high, there are some changes to the syntax support, so you need to modify the compat.h in the
#define TIMEZONE_OFFSET (foo) foo##->tm_gmtoff
For:
#define TIMEZONE_OFFSET (foo) foo->tm_gmtoff
Otherwise, you will be prompted with the following error when compiling:
Util.c:100:1: Pasting "T" and "-" does not give a valid preprocessing tokens make: [UTIL.O] Error1
=================================================
=================================================
Comment out the file for the boa.c file 225-227 three lines
if (setuid (0)! =-1) {
Die ("Icky Linux kernel bug!");
}
For
/*
if (setuid (0)! =-1) {
Die ("Icky Linux kernel bug!");
}
*/
, otherwise, the following error occurs when you start the BOA server with root privileges: Boa.c:226-icky Linux kernel bug!:
=================================================
4. Then generate Makefile:./configure
5. Modify the generated makefile: The default generated makefile for the x86 platform, our goal is to target the embedded platform, so we need to modify the compiler.
1 Change makefile 31 rows and 32 lines: 2 cc = GCC 3 cpp = Gcc-e4 changed to 5 CC = arm-linux-gcc6 CPP = arm-linux-gcc-e
6. Compile the BOA source file in the current directory: Make
7. Remove the redundant information from the generated Boa executable file: Arm-linux-strip boa. such as the size of the BOA strip before and after comparison.
< two > transfer of Boa to OK6410
1. Modify the boa.conf configuration file:
=================================================
(1) Modify the port port of line 25 to set the server listening ports: # port:the Port Boa runs on. The default port for HTTP servers is 80.# If It's less than and the server must be started as root. Port 80 (2) Comment 43 line of the listening IP address: The default listener all IP addresses on the host #listen 192.68.0.5 (3) Modify 53, 54 rows of User and group-initiated UID and GID so that it starts as root # user:the Name or UID the server should run as.# group:the Group name or GID the server should run as. User Rootgroup Root (4) modifies the DocumentRoot address of line 116, that is, the HTML page where the client will display the location # documentroot:the root directory of the HTML documents.# Comment out to disable server non user files. Documentroot/usr/local/boa (5) Modify the page to be displayed when the input Web page enters the host IP: This is set to Index.html # Directoryindex:name of the file to use as a Pre-writt En html# directory index. These FILES. On the# fly creation of directory indexes can is _slow_.# Comment out to always use Directorymakerdirectoryindex index.htm L (6) modify the location of the CGI program: When running the CGI program in a http://IP/cgi-bin/cginame way, the program will be found in the/usr/local/boa/cgi-bin directory # Scriptalias:maps A Virtual path to a directory for serving Scripts# example:scriptalias/htbin//www/htbin/scriptalias/cgi-bin//usr/local/boa/cgi-bin/
=================================================
2. Move the configuration file boa.conf to the OK6410/etc/boa/directory.
3. Create the/var/log/boa/directory so that when the BOA server starts, the log file is created in that directory.
4. Copy the/etc/mime.types files on the Linux system to the OK6410/etc directory, otherwise the BOA server will not start up.
5. Port the generated boa file to the/sbin directory in the embedded board and change the script file/etc/init.d/rcs, adding a line:/sbin/boa to ensure that the BOA server is booting from the system.
=================================================
这里一定要注意:有时候boa服务器并不能随系统启动,运行 /sbin/boa 命令会提示:
gethostbyname:: Success
这种情况下要修改boa.conf 文件
将
#ServerName www.your.org.here
改为
ServerName www.your.org.here
即去掉注释即可
=================================================
< three > Test boa server:
1. Static page test:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
2. CGI Program test:
#include <stdio.h>int Main () { printf ("content-type:text/html\n\n"); printf ("
At this point, the BOA Server migration is complete.
Reference:
1, porting the BOA server in the embedded Linux system (OK6410)
Http://www.cnblogs.com/chenchenluo/p/3576129.html
(RPM) porting a boa server in an embedded Linux system (OK6410)