嵌入式Web伺服器軟體構成與工作原理(二)

2021-05-24 23:21:26 字數 3380 閱讀 9745

boa

服務的部署

1、

解壓

# tar xzf boa-0.94.14rc21.tar.gz

2、

編譯

# cd boa-0.94.14rc21

# ./configure

生成了boa-0.94.14rc21

/src

目錄下makefile

檔案,修改

makefile

檔案,把其中的

cc  cpp

-e改為:

cc = arm-linux-gcc

cpp = arm-linux-g++

然後make

# make

刪除除錯資訊(可以不做,目的是減小檔案大小

,處理前後檔案大小對比

201503

位元組、70532

位元組):

# arm-linux-strip boa

3、

修改配置

從boa

根目錄找到

boa.conf

檔案,修改如下專案:

user nobody

(可以不修改)

group nogroup

改為:group 0

errorlog /var/log/boa/error_log

(錯誤日誌檔案)

accesslog /var/log/boa/access_log

(訪問日誌檔案,可以用#注釋掉這行,表示不要這個日誌)

servername www.my.com (

伺服器位址

)documentroot /var/www

(html

檔案主路徑)

mimetypes /etc/mime.types

(mime.types

檔案)

4、

配置開發板

1,複製

boa的可執行檔案到開發板,(如:

/usr/local/bin/ 

目錄)2

,在開發板上建資料夾

# mkdir /var/www/ ,

並放乙個簡單的

index.html

測試檔案進去

# mkdir /var/log/boa ,

用來存放

access_log error_log

3,複製之前修改好的

boa.conf

檔案到/etc/boa/boa.conf

4,複製自己pc(

fedora9

)上的mime.types

檔案,到

/etc/mime.types上

5、

執行boa

# boa

注意:

arm-linux-gcc

版本為3.4.1

boa

boa service deployment

1, extract

# tar xzf boa-0.94.14rc21.tar.gz

2, compile

# cd boa-0.94.14rc21

#. /configure

generate makefile file on boa-0.94.14rc21/src directory

modify the makefile file

from:

cc cpp-e

to:cc = arm-linux-gcc

cpp = arm-linux-g + +

then make

# make

remove debugging information (you can not do it, the purpose is to reduce the file size, file size before and after contrast 201503 bytes, 70532 bytes):

# arm-linux-strip boa

3, modify the configuration

from the root directory to find boa.conf boa file

modify the following items:

user nobody (modify or not)

from:group nogroup to: group 0

errorlog /var/log/boa/error_log (error log file)

accesslog /var/log/boa/access_log (access log files, you can use the # comment out this line that should not use log)

servername www.my.com (server address)

documentroot /var/www (html file the main path)

mimetypes /etc/mime.types (mime.types file)

more configuration, you can see:

4, configuration, development board

1, copy the executable file boa to the development board, (such as /usr/local/bin/ directory)

2, create folders on development board

# mkdir /var/www/, and put a ****** index.html test file into the directory

# mkdir /var/log/boa, used to store access_log error_log

3, copy the file boa.conf that had been modified well to /etc/boa/boa.conf

4, copy your pc (fedora9) the mime.types file to /etc/mime.types

5, running boa

# boa

note:

arm-linux-gcc version 3.4.1

boa download:

嵌入式Web伺服器移植

或者 最新發行版本 0.94.13 解壓 tar xzf boa 0.94.13.tar.gz 直接執行src configure檔案 a 修改 cc gcc 為 cc usr local arm 2.95.3 bin arm linux gcc b 修改 cpp gcc e 為 cpp usr l...

嵌入式Web伺服器移植

文章一僅供個人學習之用,請勿用於他途。n printf n printf n printf n printf n exit 0 交叉編譯生成helloworld.cgi arm softfloat linux gnu gcc o helloworld.cgi helloworld.c 將hellow...

嵌入式web伺服器的實現

1 引言 呼叫 open 開啟裝置,利用 ioctl 對裝置進行控制,比如設定對比度 亮度 調色盤,訪問模式等等。主要 如下 int fd open dev v4l video0 o rdwr 開啟裝置 獲取裝置的基本資訊 裝置名稱 支援的最大最小解析度 訊號源資訊等 ioctl vd fd,vid...