一、嵌入式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>