Cross-Compilation of light http Server boa

Source: Internet
Author: User
Cross-Compilation of light http Server boa-Linux Enterprise Application-Linux server application information. The following is a detailed description. Cross-compile boa
./Configure -- build = i486-linux-gnu -- host = mipsel-linux -- prefix =/usr
Modify Makefile
A. Modify CC = gcc
CC = mipsel-linux-gcc
B. Modify CPP = gcc-E
CPP = mipsel-linux-gcc-E
Modify src/defines. h
Set # define DEFAULT_PATH "/bin:/usr/local/bin"
Change to # define DEFAULT_PATH "/bin:/usr/bin:/var/www"
Make
Mipsel-linux-strip boa

Step 2: Configure Boa
Boa needs to create a boa directory under the/etc directory and put Boa. conf, the main configuration file of boa. There is an example Boa. conf In The boa Source Code Directory, which can be modified based on it.
User 0
Group 0
# DirectoryMaker/usr/lib/boa/boa_indexer
CGIPath/bin:/usr/bin:/var/www/cgi-bin
ScriptAlias/cgi-bin // var/www/cgi-bin/

Mkdir-p/var/log/boa
Mkdir-p/var/www/
Chmod 777/var/www
Mkdir-p/var/www/cgi-bin
Chmod 777/var/www/cgi-bin
From the cross-tool chain/opt/mipseltools/mipsel-linux/lib/copy library files to the file system
Cp-av libnss_files.so libnss_files.so.2 libnss_files-2.3.2.so libnss_nis.so libnss_nis.so.2 libnss_nis-2.3.2.so libnss_nisplus.so libnss_nisplus.so.2 libnss_nisplus-2.3.2.so
Touch/etc/ld. so. preload
Touch/etc/ld. so. cache
Touch/var/run/. nscd_socket

Test http:
Http: // 192.168.4.84/
Test cgi:
Http: // 192.168.4.84/cgi-bin/helloworld. cgi
FAQ:
1.
Mipsel-linux-gcc-g-O2-pipe-Wall-I.-c-o util. o util. c
Util. c: 100: 40: pasting "t" and "->" does not give a valid preprocessing token
Make: *** [util. o] Error 1

Solution:

Modify src/compat. h
Find
# Define TIMEZONE_OFFSET (foo) foo #-> tm_gmtoff
Modify
# Define TIMEZONE_OFFSET (foo)-> tm_gmtoff

2.
Boa cannot be started normally. Check the ErrorLog and you can see that "boa. c: 266. icky Linux kernel bug! : No such file ". To solve this problem, remove the following lines in the boa. c file.

Solution:

If (setuid (0 )! =-1 ){
DIE ("icky Linux kernel bug! ");
}
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.