嵌入式boa+cgi安裝及使用


一、嵌入式boa配置說明
tar -zxvf boa-0.94.13.gz
cd boa-0.94.13/src
./configure

修改Makefile文件

CC=gcc      ==>> CC=arm-linux-gnueabihf-gcc
CPP=gcc -E  ==>> CPP=arm-linux-gnueabihf-gcc -E
make
會報錯
執行如下命令
sudo apt-get install flex
make

將生成的boa、mime.types以及boa.conf拷貝到nfs服務上
cp boa ~/share/nfs
cp ../boa.conf ~share/nfs
cp  ../../../httpd-2.4.2/docs/conf/mime.types  ~/share/nfs/

在嵌入式板子上生成以下目錄
cd /etc
mkdir -m 777 boa
cp ~/nfs/boa.conf /etc/boa
cp ~/nfs/mime.types /etc

vi boa.conf
修改boa.conf爲如下
===================================
Port 8080
User nobody
Group nogroup
#ServerAdmin root@localhost
ErrorLog /srv/www/log/error_log
# Access logging.
AccessLog /srv/www/log/access_log
ServerName www.cgitest.com
DocumentRoot /srv/www
UserDir public_html
DirectoryIndex index.html
DirectoryMaker /usr/lib/boa/boa_indexer
KeepAliveMax 1000
KeepAliveTimeout 10
MimeTypes /etc/mime.types
DefaultType text/html
CGIPath /bin:/usr/bin:/usr/local/bin
Alias /doc /usr/doc
ScriptAlias /cgi-bin/ /srv/www/cgi-bin/
AddType application/x-httpd-cgi cgi
===================================

配置web服務器文件
cd /srv/www

vi index.html
===================================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<meta name="Form" content="Feng">
<meta name="Input" content="Feng">
<title>輸入</title>
</head>
<body>
<h1>輸入兩個數</h1>
<form name="form1" ACTION="./cgi-bin/multi" method=get >
        <p>
        <INPUT NAME="m" SIZE="5">
        *
        <INPUT NAME="n" SIZE="5"><BR><BR>
        </p>
<INPUT TYPE="SUBMIT" values="計算"> 
</form>
<BR>
 
</body>
</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章