移植thttpd——輕量級的Web Server

來源:互聯網
上載者:User
移植thttpd Web伺服器

下載
從http://www.acme.com/software/thttpd/ 下載thttpd

編譯thttpd
CC=/opt/host/armv4l/bin/armv4l-unknown-linux-gcc ./configure host=arm-linux

vi Makefile

指定靜態連結二進位檔案
LDFLAGS = static

make LDFLAGS="static"

配置

拷貝thttpd二進位可執行檔到根檔案系統/usr/sbin/目錄中
修改thttpd設定檔

vi thttpd.conf

# This section overrides defaults
dir=/etc/thttpd/html #指明WebServer存放網頁的根目錄路徑
chroot
user=root #以root身份運行thttpd
logfile=/etc/thttpd/log/thttpd.log #記錄檔路徑
pidfile=/etc/thttpd/run/thttpd.pid #pid檔案路徑

拷貝thttpd.conf設定檔到根檔案系統的mnt/etc/目錄,
系統載入後,linuxrc指令碼會自動將mnt/etc/下的所有檔案拷貝到/etc目錄中。

轉移到根檔案系統目錄,建立相應的檔案

thttpd目錄下的目錄結構
|html
| `index.
html Web Server網頁根目錄下的預設HTML檔案
|log
| `thttpd.
log 建立一個空檔案就可
`run
`thttpd.
pid 建立一個空檔案就可

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.