V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
AllenHua
V2EX  ›  问与答

求助一个 lighttpd auth 认证的问题

  •  
  •   AllenHua · 2021 年 2 月 5 日 · 827 次点击
    这是一个创建于 1886 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用 openwrt + lighttpd + webdav 搭建了一个 webdav 服务,server 用的 lighttpd, 认证用的 lighttpd-mod-authlighttpd-mod-authn_file

    下面是配置文件 /etc/lighttpd/conf.d/20-auth.conf

    #######################################################################
    ##
    ##  Authentication Module
    ## -----------------------
    ##
    ## See https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modauth
    ## for more info.
    ##
    server.modules += ( "mod_auth" )
    
    auth.backend                 = "plain"
    auth.backend.plain.userfile  = "/etc/lighttpd/lighttpd.user"
    #auth.backend.plain.groupfile = "/etc/lighttpd/lighttpd.group"
    
    #auth.backend.ldap.hostname = "localhost"
    #auth.backend.ldap.base-dn  = "dc=my-domain,dc=com"
    #auth.backend.ldap.filter   = "(uid=$)"
    
    auth.require               = ( "/" =>
                                   (
                                     "method"  => "basic",
                                     "realm"   => "Allen Hua's WebDAV File Server",
                                     "require" => "valid-user"
                                   ),
                                 )
    
    auth.cache = ("max-age" => "180")
    
    ##
    #######################################################################
    

    目前达成既定目标,可以正常认证

    yGHVIK.png

    yGHAVx.png

    希望优化的点:

    优化成每次都需要认证,或者设置一个缓存时间 5 分钟内才不需要认证(因为通过 frp 内网穿透了 通过外网访问 希望安全一些每次都能认证一下)

    看了下 官方文档 https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modauth 中的 auth.cache 相关的配置,目前在配置文件中给定了配置但没有生效,希望有懂的 v 友给点思路或意见!

    感谢阅读。

    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   4717 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:02 · PVG 18:02 · LAX 03:02 · JFK 06:02
    ♥ Do have faith in what you're doing.