Learning embedded Linux In the process, has always wanted to build a network server, running on the board of S3c2410, as a simple human-computer interface, but also in the industrial scene is one of the more commonly used embedded applications.
Choose to choose, or boa better, because this Linux under the webserver is very simple, designers consider the first factor is speed and security, select a single task Single-user mode, for simple requirements of the safety of industrial applications should be more appropriate.
And according to boa.org website data, faster than Apache a little faster. So download and install the package, search the Internet some configuration methods, combined with their own practice, and finally succeeded in their own virtual machine Ubuntu10.0 system configured successfully, in the Firefox browser can access the server.
The fastest configuration steps are as follows, and you can refer to the instructions in the appendix for changes if you want to change the configuration. Make a summary of yourself and also hope to have some reference value to others.
1 . Download Boa on www.boa.org, current version 0.94.13, put in a directory
2 . Decompression Boa: $ tar-zxvf boa-0.94.13.tar.gz
3 . Access to the source directory: $ cd boa-0.94.13/src
4 . Execute configuration script: $./configure
Checks if the required tool exists, yes means there is, no indicates that it does not exist. All that does not exist is not necessarily installed. Error executing make prompts for missing commands ...
in an Ubuntu system, you may be prompted not to find the YACC and Lex commands, if you execute the following sentence:
sudo apt-get install YACC Lex
will find that it has failed. In fact , the right way is
sudo apt-get install Flex bison
because of the use of flex and bison in the Ubuntu system instead of Lex and YACC.
5 . Modify line 120th of the compat.h, or you will compile an error
Modified: #define TIMEZONE_OFFSET (foo) Foo##->tm_gmtoff
replaced by: #define TIMEZONE_OFFSET (foo) Foo->tm_gmtoff
Modify the 73rd line of the LOG.C, otherwise you may dup2 an error.
Comment out this paragraph:
/* IF (dup2 (error_log, stderr_fileno) = = 1) {
DIE ("Unable to dup2 the error log");
} */
6 . Other default
7 . Compiling: $ make
generate boa and boa_indexer
8 . Slimming (for Embedded systems): $ strip Boa $ strip boa_indexer
9 . Copy boa, Boa_indexer, defines.h to/etc/boa directory.
$ sudo mkdir/etc/boa
$ sudo cp boa Boa_indexer Defines.h/etc/boa
This directory is the running start directory for the BOA server, defined in Defines.h by Server_boot.
Ten . Go back to the parent directory and modify the boa.conf configuration file.
$ cd ... /
$ vim boa.conf
modified: scriptalias/cgi-bin//usr/lib/cgi-bin/
instead: scriptalias/cgi-bin//var/www/cgi-bin/
Modification: directorymaker/usr/lib/boa_indexer
replaced by: directorymaker/etc/boa/boa_indexer
Save, copy boa.conf to/etc/boa/directory.
one by one . Create the folder you want
$ Mkdir/var/www/var/www/cgi-bin/var/log/boa
Run the BOA server
$/etc/boa/boa
Verify that the server is running successfully
(1) Open the browser, any save a Web page for HTML format, such as Baidu.html
(2) Copy the baidu.html file to the/var/www directory.
(3) in the browser address bar input http://localhost/baidu.html can be seen.
Appendix: Boa Webserver Configuration parameter Description:
Port: Boa The server listens on the ports, the default port is 80. If the port is less than 1024, the root user must start the server.
Listen : The IP address of the binding. When this parameter is not used, all addresses are bound.
User: The identity of the client connected to the server, which can be a username or UID.
Group: Groups of clients connected to the server, either a group name or a GID.
ServerAdmin : The mailbox address to notify when the server fails.
ErrorLog : Specifies the error log file. If the path does not start with "/", it is relative to the ServerRoot path. The default file is/dev/stderr when no configuration is configured. If you do not want to log, specify the file as/dev/null.
accesslog : Set access log files, similar to ErrorLog.
uselocaltime : Set to use local time and annotate this parameter when using UTC. This parameter has no value.
verbosecgilogs : Record the CGI start and stop time in the error log file, and note This parameter if not logged. This parameter has no value.
ServerName : Specifies the name of the server that is returned to the client when the client uses GetHostName + gethostbyname.
virtualhost : Virtual host switch. Using this parameter, an IP address is added as a new documentroot to handle the client's request in the directory set by DocumentRoot. If DocumentRoot is set to/var/www, then http://localhost/is converted to/VAR/WWW/127.0.0.1/, or/var/www/if this parameter is annotated.
DocumentRoot : The root directory of the HTML file (that is, the directory of the Web site).
Userdir : Specifies the user directory.
DirectoryIndex : Specifies the file in which to generate the catalog information, note that this variable will use the Directorymaker variable. This variable is the file name that sets the default home page.
Directorymaker : Specifies the program used to build the directory, and note that this variable will not allow the column directory.
Directorycache : When the DirectoryIndex file does not exist, and Direcotrymaker is commented out, this parameter will be listed to specify the directory to the client.
Keepalivemax : The number of requests allowed per connection. Setting this value to "0" will not limit the number of requests.
KeepAliveTimeout : The number of seconds to wait for the next request before closing the persistent connection. (seconds).
mimetypes : Set up a file containing mimetypes information, usually/etc/mime.types.
defaulttype : The default mimetype type, usually text/html.
Cgipath : Equivalent to the $PATH variable used for CGI programs.
singlepostlimit : The maximum number of bytes allowed on a single POST, 1MB by default.
AddType : Added mimetype No specified type, example: AddType type extension [extension ...]. To use CGI, you must add a CGI type: AddType application/x-httpd-cgi CGI
Redirect : Redirecting files
aliases : Specifies the alias of the path.
Scriptalias : Specifies the virtual path of the script path.