移植 thttpd Web服务器
從http://www.acme.com/software/thttpd/ 下載thttpd 到/tmp 目錄當(dāng)中,并解壓.
編譯thttpd
[arm@localhost thttpd-2.25b]$ CC=arm-linux-gcc ./configure --host=arm-linux
[arm@localhost thttpd-2.25b]$ vi Makefile
指定靜態(tài)鏈接二進制文件
LDFLAGS =?????? -static
[arm@localhost thttpd-2.25b]$ make LDFLAGS="-static"
配置
拷貝 thttpd二進制可執(zhí)行文件到根文件系統(tǒng)/ usr/sbin/ 目錄中
[arm@localhost thttpd-2.25b]$ cp thttpd /home/arm/dev_home/rootfs/my_rootfs/usr/sbin/
修改 thttpd配置文件
[arm@localhost thttpd-2.25b]$ vi contrib/redhat-rpm/thttpd.conf
# This section overrides defaults
dir=/etc/thttpd/html??????????? #指明WebServer 存放網(wǎng)頁的根目錄路徑
chroot
user=root?????????????????????? # 以root 身份運?????? thttpd
logfile=/etc/thttpd/log/thttpd.log # 日志文件路徑
pidfile=/etc/thttpd/run/thttpd.pid #pid 文件路徑
拷貝thttpd.conf 配置文件到根文件系統(tǒng)的mnt/etc/ 目錄,
系統(tǒng)加載后,linuxrc 腳本會自動將mnt/etc/下的所有文件拷貝到/etc 目錄中。
[arm@localhost thttpd-2.25b]$ cp contrib/redhat-rpm/thttpd.conf /home/arm/dev_home/rootfs/my_rootfs/mnt/etc/
轉(zhuǎn)移到根文件系統(tǒng)目錄,創(chuàng)建相應(yīng)的文件
[arm@localhost etc]$ cd /home/arm/dev_home/rootfs/my_rootfs
[arm@localhost my_rootfs]$ cd mnt/etc/
創(chuàng)建thttpd 目錄
[arm@localhost etc]$ mkdir thttpd
[arm@localhost etc]$ cd thttpd
thttpd 目錄下的目錄結(jié)構(gòu)
|-- html
| `-- index.html Web Server 網(wǎng)頁根目錄下的默認HTML 文件
|-- log
| `-- thttpd.log 創(chuàng)建一個空文件就可
`-- run
??? `-- thttpd.pid 創(chuàng)建一個空文件就可
html 目錄下的index.html 文件內(nèi)容如下:
<html>
<head>
??????? <title> Welcome to here^^ </title>
</head>
<body>
??????? <marquee>
??????????????? <font color=red>
??????????????????????? Welcome to here^^!!!
??????????????? </font>
??????? </marquee>
</body>
</html>
總結(jié)
以上是生活随笔為你收集整理的移植 thttpd Web服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 第三者险多少钱啊?
- 下一篇: 美国电影几个年轻人通过豆茎藤蔓爬到天上,