移植thttpd Web伺服器到ARM-Linux系統

來源:互聯網
上載者:User

thttpd是個小型的web伺服器。是移植到arm的不錯選擇,今天配置了一下,其中遇到了一些問題。當自己做個備份,也分享一下自己的配置經驗吧。

CC=arm-linux-gcc ./configure --host=arm-linux-gcc
vi Makefile
/*指定靜態編譯,就可以省去動態庫的移動*/
LDFLAGS=   -staticmake LDFLAGS="-static"
cp thttpd /usr/sbin(可以直接使用thttpd命令)
vi thttpd/contrib/redhat-rpm/thttpd.conf
/*-----修改內容如下------*/
dir=/etc/thttpd/html
#指明 WebServer 存放網頁的根目錄路徑
chroot
user=root
#以 root 身份運行 thttpd
logfile=/etc/thttpd/log/thttpd.log #記錄檔路徑
pidfile=/etc/thttpd/run/thttpd.pid #pid 檔案路徑
/*其中這些變數的設定因實際情況而定*/
cp  thttpd/contrib/redhat-rpm/thttpd.conf /etc
cd /home( 開發板上的目錄 )
mkdir thttpd
cd thttpd
mkdir html
(有個index.html檔案)
mkdir log
(thttpd.log)//空檔案
mkdir run
(thttpd.pid)//空檔案

放置一個index.html檔案到html裡面
測試:
#  thttpd  -C  /etc/thttpd.conf

然後用開啟瀏覽器,輸入開發板ip即可訪問。

如果遇到./thttpd: unknown user - 'root'的問題,請檢查thttpd.conf檔案。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.