Embedded Web Server on-port BOA in uClinux

Source: Internet
Author: User

In uClinux, there are three main Web servers: httpd, thttpd, and boa. Httpd is the simplest Web server. It has the weakest function, does not support authentication, and does not support CGI. Both thttpd and BOA support authentication, CGI, and other functions. To implement dynamic Web technology, we choose to implement a Boa web server that supports CGI and is very suitable for embedded systems.
Boa is an HTTP server for a single task, with open source code and high performance. Currently, the uClinux Code contains the Boa Source Code. To implement BOA in uClinux, You need to configure and modify boa. This is implemented by modifying the BoA. conf and mime. types files. The following configuration items need to be modified.
(1) create a directory
Since the default root file system romfs in uClinux is read-only, you cannot use commands such as mkdir to create a directory. Therefore, you should first create the directory to be used before compiling the kernel/

UClinux-Samsung/vendors/Samsung/4510b/makefile
Romfs_dirs = bin Dev etc home lib MNT proc USR var added home/Web home/web/cgi-bin

3.7
Modify it in the/uClinux-Samsung/vendors/Samsung/4510b/inittab,
After: iNet: Unknown:/bin/inetd, add: Boa: Unknown:/bin/BOAC/home.

(2) Specify the root directory path of the Web server (server_root)
 
/UClinux-Samsung/user/BOA/src/directory,
Modify the # define erver_root "/home" statement in the define. h file to specify server_root.

(3) modify the BoA. conf file
3.1
In./uClinux-Samsung/user/BOA/src/boa. conf, modify:
* Change User obody to user 0.
Change Group ogroup to group 0;

3.2
* Set DocumentRoot/var/WWW
Change to DocumentRoot/home/web,

3.4
* Set mimetypes/etc/mime. Types
Changed to mimetypes/home/web/mime. types;

3.5
Define the default home page and CGI program directory, that is

Directoryindex index.html
ScriptAlias/cgi-bin // home/web/cgi-bin/

After this example, .index.htm is the default value for the homepage seen by the client accessing the Web server remotely. It is compiled into a binary file using CGI program written in C and stored in the/cgi-bin/directory, CGI programs can be correctly executed.

3.6
Boa. CONF file and mime. the types file must be placed in the root directory of the web server, so the modified Bao. conf and mime. copy types to ". /uClinux-Samsung/romfs/home/"directory.

3.8
Make menuconfig ------> kernel ---> user setting ----> miscellaneous configuration ---> generic CGI & cgihtml

After the configuration process, re-compile the kernel and select the boa option during compilation. Download the compiled kernel to the Development Board, start uClinux, complete the IP configuration, start the Boa web server, and then you can access your web page through IE. If you want to enable the Boa web server automatically when starting uClinux, you can modify the RC file, go to the uClinux-Samsung/vendors/Samsung/4510b directory, and add two lines in the script RC:

Ifconfig eth0 192.168.168.101 up
BOA-C/home /&

After modification, recompile the kernel and then download it to the Development Board for running. After running uClinux, you can directly access your webpage through ie without configuration.

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.