Embedded Linux CGI Programming Technology

Source: Internet
Author: User
Article title: CGI program design technology in the embedded Linux operating system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1 Overview

With the popularization of Internet applications, more and more information products need to access the Internet for remote access through Web pages. The embedded Web system provides an economic and practical Internet embedded access solution. Here we introduce CGI Programming Technology in embedded Linux with an embedded Web Server BOA.

2. implementation and configuration of Web Server BOA

2.1 In uClinux, there are three main Web servers: HTTPD, THTTPD, and BOA.

HTTPD is the simplest Web Server. it has the weakest functions, does not support authentication, does not support CGI. THTTPD and BOA both support authentication, CGI, and other functions. BOA is a small HTTP server with a single task. it has open source code and excellent performance. it is especially suitable for embedded systems. Currently, the uClinux code contains the BOA source code. To implement BOA in uClinux, you only need to configure and modify BOA. The following is the configuration process.

(1) compile BOA to the kernel

First, you need to compile BOA to the kernel, that is, execute make menuconfig. in the application menu, select boa under the network application option. this operation requires re-compiling the kernel.

(2) compile the configuration file boa. conf.

In the Linux operating system, application configurations are provided in the form of configuration files, usually in the target board/etc/directory or/etc/config directory. However, the boa configuration file boa. cont is usually rotated in the target board/home/httpd/directory.

For example, a typical boa. conf file format is as follows:

     
      ServerName Samsung-armDocumentRoot/home/httpdScriptAlias/cgi-bin/home/httpd/cgi-bin/            ScriptAlias/index.html/home/httpd/index.html
     

It specifies that HTML pages must be placed in the/home/httpd directory, and cgi external extensions must be placed in the/home/httpd/cgi-bin directory.

(3) compile and burn the kernel

After re-compiling the kernel, you can use a writing tool to burn the kernel to access the Web Server on the development board through the IE browser on the PC. for example, you can enter the IP address of the development board http: // 192.168.0.101 to access the webpage index.html. In addition, by writing CGI external extensions, you can implement dynamic Web technology. The following describes in detail.

2.2 implementation and configuration of B0A in Linux with MMU platform

For platforms with MMU (memory management unit), such as armlinux and ppclinux, you can download a mainstream boa release package online. Because it runs in the target system, you must use the cross-compilation tool to compile the program. that is, you must modify the compiler in boa/src/Makefile. For example:

     
      CC=/LinuxPPC/CDK/bin/powerpc-linux-gcc            CPP=/LinuxPPC/CDK/bin/powerpc-linux-g++
     

Then, execute make in the boa/src directory to generate the BOA executable file. compile it into the kernel and write it to the storage device to access the BOA server.

[1] [2] [3] [4] Next page

Related Article

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.