lighttpd 打底了幾天, 該來辦正事啦 !
照慣例, 先打開 /usr/local/lighttpd/sbin/lighttpd.conf 來修改 ...
1. 加上 webdav 模組
server.modules += ( "mod_webdav" )
2. 指定 webdav 別名, 和對應到的實際路徑
alias.url += (
"/webdav/"=>"/usr/local/lighttpd/www/webdav/"
)
3. 打開 webdav 功能, 取消唯讀, 支援dir, 並把 authentication 的部份加進來.
$HTTP["url"] =~ "^/webdav($|/)" {
webdav.activate = "enable"
webdav.is-readonly = "disable"
dir-listing.activate = "enable"
#webdav.sqlite-db-name =
auth.backend = "plain"
auth.backend.plain.userfile = "/usr/local/lighttpd/auth/.auth"
auth.require = ("/"=>(
"method" => "basic",
"realm" => "Please Input User Name",
"require" => "user=admin")
)
}
4. 關掉 lighttpd, 再打開
killall lighttpd; ./lighttpd -f lighttpd.conf
結果就爆炸啦 ...
No package 'libxml-2.0' found
看來是 xml-2.0 沒裝, 那就裝 ! 再跑 ! (killall lighttpd; ./lighttpd -f lighttpd.conf)
然後還是爆炸 ...
No package 'sqlite3' found
看來是 sqlite3 沒裝, 那就裝 ! 再跑 ! (killall lighttpd; ./lighttpd -f lighttpd.conf)
結果還是爆炸 ...
(plugin.c.169) dlopen() failed for: /usr/lib/lighttpd/mod_webdav.so /usr/lib/lighttpd/mod_webdav.so: cannot open shared object file: No such file or directory
看起來就是一開始在 configure 的時候, 有東西沒打開 ...
那就開吧 !
回到 source, 重新進行 configure - make - make install 三部曲 ...
./configure --prefix=/usr/local/lighttpd --with-webdav-props --with-webdav-locks
make; make install
再跑一次 ! (killall lighttpd; ./lighttpd -f lighttpd.conf)
結果還是 gg ...
(network.c.400) SSL: ssl requested but openssl support is not compiled in
重複剛才步驟, 加上 --with-openssl
./configure --prefix=/usr/local/lighttpd --with-openssl --with-webdav-props --with-webdav-locks
make; make install
再跑一次 ! (killall lighttpd; ./lighttpd -f lighttpd.conf)
Great !!!!!!!
網頁輸入 https://xxx.xxx.xxx.xxx/webdav/
成功列出我放在路徑下的所有檔案 !!!
趕緊再來裝一個 webdav client 來試試看,
listing, get, 成功 !!!
put ... 失敗 ... what the f ...
403 forbidden
火大, 把 webdav 資料夾一律改為 777,
再試一次 (killall lighttpd; ./lighttpd -f lighttpd.conf),
總算 put 成功囉 ...
下一步, 把這傢伙導到 embedded 板子上 ...
參考:
1. lighttpd configure options example:
http://www.cyberciti.biz/tips/installing-and-configuring-lighttpd-webserver-howto.html
2. install xml2 from source
http://www.cnblogs.com/lynch_world/archive/2012/06/28/2568395.html
3. install xml2 using apt-get
http://www.360doc.com/content/12/0223/15/8500224_189020735.shtml
4. install sqlite3
http://askubuntu.com/questions/208393/need-help-installing-sqlite3
5. ./lighttpd -m library位置
http://serverfault.com/questions/135583/setting-module-path-in-lighttpd-config-file
6. webdav PUT fail - 403 forbidden
http://ubuntuforums.org/showthread.php?t=2041153
7. lighttpd + webdav
http://tc.itkee.com/sysapp/detail-16d5.html
http://jamyy.dyndns.org/blog/2013/04/4694.html
留言列表