Boa web server configuration in uClinux

Source: Internet
Author: User
Configuration of Boa web server in uClinux by wzc0066
Source: www.mcuos.com
Body:

I. Environment preparation

Compiling environment: uClinux-dist-20040408.tar.gz
Compilation tool: Arm-elf -*
Model: smartarm2200

Ii. Compilation Configuration

1. Select kernel/library/defaults selection-> customize vendor/user settings-> network applications-> boa and compile

2. Configure the Boa web server:

2.1 modify the file uClinux-Dist/user/BOA/src/defines. h
Change # define server_root "/home/httpd" to # define server_root "/etc/boa"
This means to set the serverroot path of the BOA Web server to/etc/boa.

2.2 edit the configuration file uClinux-Dist/user/BOA/examples/boa. conf as follows:
Port 80
User 0
Group 0
DocumentRoot/var/WWW
Userdir public_html
Directoryindex index.html
Keepalivemax 1000
Keepalivetimeout 10
Defaulttype text/html
Addtype application/X-httpd-CGI
ScriptAlias/cgi-bin // var/www/cgi-bin/
Addtype image/JPEG JPG

Description of the configuration file:
(1) The * log options are commented out. Otherwise, the system prompts that these * log tags are not recognized when boa is started;
(2) The "mime. types" option is not added. For details, see the garbled characters in the BOA test image;
(3) the configuration file boa. conf needs to be copied to serverroot. You can manually or modify the MAKEFILE file (uClinux-Dist/vendors/Philips/lpc2200/makefile;
If the location of the configuration file boa. conf is incorrect, the configuration file "authentication password file for/cgi-bin/not found!" is displayed !" Errors!

Iii. debugging

1. If boa & (or BOA-C/var/WWW & is run, but DocumentRoot/var/WWW has been specified, run the Command outside ), will get the error message "kmod: failed to Exec/sbin/modprobe-S-knet-pf-1, errno = 2", at this time Boa web server is not available!

2. Add and compile kernel/library/defaults selection-> customize vendor/user settings-> busybox-> modprobe and re-compile the code. Then, run boa & and the following error message is displayed:

_ Alloc_pages: 6-order allocation failed (Green = 0x1f0/0)
Allocation of length 164704 from process 193 failed
Buffer Memory: 52kb
Cache memory: 1076kb
Free pages: 876kb (0kb highmem)
Zonema freepages: 0kb
ZONE: normal freepages: 876kb
ZONE: highmem freepages: 0kb
(Active: 94, inactive: 188, free: 219)
= 0 KB)
25 * 4kb 21 * 8kb 12 * 16kb 5 * 32kb 2 * 64kb 1 * 128kb 0 * 256kb 0 * 512kb 0 * 1024kb 0 * 2048kb = 876kb)
= 0 KB)
Unable to MMAP process text, errno 12
Kmod: failed to Exec/sbin/modprobe-S-K net-pf-1, errno = 12
_ Alloc_pages: 6-order allocation failed (Green = 0x1f0/0)
Allocation of length 164704 from process 195 failed
Buffer Memory: 52kb
Cache memory: 1076kb
Free pages: 700kb (0kb highmem)
Zonema freepages: 0kb
ZONE: normal freepages: 700kb
ZONE: highmem freepages: 0kb
(Active: 47, inactive: 235, free: 175)
= 0 KB)
25 * 4kb 19 * 8kb 12 * 16kb 4 * 32kb 2 * 64kb 0 * 128kb 0 * 256kb 0 * 512kb 0 * 1024kb 0 * 2048kb = 700kb)
= 0 KB)
Unable to MMAP process text, errno 12
Munmap of non-mmaped memory by process 195 (insmod): 817fb000
Munmap of non-mmaped memory by process 195 (insmod): 815863a0
Unhandled fault: External abort on linefetch (F4) at 0x00000001
The fault-common.c (97): start_code = 0x81380040, start_stack = 0x815bff74)
PID 182: Failed 256

Memory Allocation Error! But now Boa web server is accessible!

3. Add and compile kernel/library/defaults selection-> customize kernel settings-> networking options-> Unix domain sockets and re-compile it. Besides a PID, no extra information! (What is the function of this option? I still don't know !)

IV. Other Instructions

Refer is included in the CD )!

2. During Web Testing, HTML files should be stored in the/var/WWW directory, and CGI programs should be stored in the/var/www/cgi-bin directory, these are clearly written in the configuration file!

3. You can also perform Web Testing through NFS (this saves you the trouble of writing multiple times). For details about NFS configuration, see http://wzc0066.blog.hexun.com/651_93_d.html.

V. Existing Problems

At present, CGI, JavaScript, Image Browsing and other tests are all good! However, when testing MP3, it still does not work, probably because it does not support large files!

In my opinion, it seems that the maximum memory allocated each time in uClinux is 128 kb by default. Therefore, if you run a file larger than kb, an error will occur!

I also saw a piece of information saying that a large file can be supported after selecting a configuration in the kernel hacking, but I cannot find the one I mentioned on the Internet in the 2.4.x kernel!

The following error message is displayed when you click an MP3 file (MB:
Allocation of length 2502723 from process 24 failed
Buffer Memory: 56kb
Cache memory: 2744kb
Free pages: 2420kb (0kb highmem)
Zonema freepages: 0kb
ZONE: normal freepages: 2420kb
ZONE: highmem freepages: 0kb
(Active: 98, inactive: 602, free: 605)
= 0 KB)
7 * 4kb 9 * 8kb 11 * 16kb 7 * 32kb 4 * 64kb 1 * 128kb 0 * 256kb 1 * 512kb 1 * 1024kb 0 * 2048kb = 2420kb)
= 0 KB)
Munmap of non-mmaped memory by process 24 (BOA): ffffffff

Although it is still not perfect, it is still okay to use it in general! This is the general process of configuring my Boa web server!

Latest Update: AboutLarge Memory Allocation in uClinux

When you run an application that exceeds 1 MB, the uClinux system reports a memory allocation error!
When compiling the kernel, You need to select the "allow allocating large blocks (> 1 MB) of memory" option to solve the problem!
However, it is not easy for new users to locate this option. The detailed operation process is as follows:

  • The macro corresponding to this configuration option is: config_no_mmu_large_allocs.
  • First, select prompt for development and/or incomplete code/drivers in code maturity level options.
  • Then you can see the non power-of-2 kernel Allocator (experimental) option in the kernel hacking,
  • Select this option and you will see allow allocating large blocks (> 1 MB) of memory. Select this option!
Available points:
4117 points
Expert points:
3000 points
Training points:
0 Points
Management points:
3000 points

View personal websites

View Details

Top

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.