August 9,2006

lighttpd auth

本網頁取自 此頁
記載著 lighttpd 的 auth 方式

lighttpd config



  • 在 lighttpd.conf 加入 mod_auth

  • 在 mod_auth 裡面加入

    auth.debug = 2
    auth.backend = “plain”
    auth.backend.plain.userfile = “/home/lighttpd/.lighttpdpassword”

    裡面的 auth.backend.plain.userfile = “/home/lighttpd/.lighttpdpassword”
    代表 password放置的放置的 file location

  • 加入

    auth.require = ( “/docs/” =>
    (
    “method” => “basic”,
    “realm” => “Password protected area”,
    “require” => “user=aaa”
    )
    )

    “require” => “user=aaa”代表 /doc 只有 aaa 這個人可以登入


建立 password file


vi /home/lighttpd/.lighttpdpassword
在裡面寫入

aaa=password

並且將這個 file 設為只有 lighttpd 可以讀

Posted by thegiive at 樂多Roodo! │16:43 │回應(0)引用(0)Web Server
樂多分類:網路/3C 工具:編輯本文
Ads by Roodo! 

引用URL

http://cgi.blog.roodo.com/trackback/1993478