實現在Windows下安裝Lighttpd的方法

來源:互聯網
上載者:User

  大致經曆一下幾個步驟:

  1、windows系統下需要cygwin 環境的支援,如是先下載安裝cygwin。

  2、下載lighttpd原始碼並解壓(from http://trac.lighttpd.net/)

  3、在cygwin 環境下進入lighttpd的下載後儲存的目錄,依次執行以下命令:

  1> ./configure –prefix=C:/lighthttd

  2> make

  3> make install

  如無報錯,則安裝成功。

  4、在C:/lighthttd下建一個目錄etc 用於存放設定檔,建立一個設定檔lighttpd.conf,樣本配置如下:

  server.document-root = "D:/Itang_home/MyPics/100CANON"

  server.port = 8080

  mimetype.assign = (

  ".html" => "text/html",

  ".txt" => "text/plain",

  ".jpg" => "image/jpeg",

  ".png" => "image/png"

  )

  5、windows命令列環境下進入C:/lighthttd/sbin目錄,運行 lighttpd -t -f ..\etc\lighttpd.conf 測試是否安裝配置成功。

  此時會提示cygwin1.dll 等lighttpd 運行時依賴cygwin 的DLL不存在,那麼需要到cygwin 的bin目錄找到相應的dll拷貝到C:/lighthttd/sbin目錄下,再運行 lighttpd -t -f ..\etc\lighttpd.conf 直到出現提示 "Syntax OK" ,則表示安裝配置成功。

  6、運行lighttpd -D -f ..\etc\lighttpd.conf啟動Web伺服器。

  7、瀏覽器裡訪問,顯示圖片,大功告成。

  在進程管理器查看啟動後記憶體僅僅佔用4M,挺精巧的。訪問速度也挺快。以後多看看官方文檔,結合實際應用多折騰一下它。如有可能將其應用到實際項目中去。

  註:樣本只是配置了對靜態資源的訪問。後續如何相關應用(比如結合tomcat,ruby等) 則需要看官方文檔(http://trac.lighttpd.net/trac/wiki/)。

相關文章

聯繫我們

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