在DokuWiki中使用 .htaccess 认证

风行水上 @ 2010-07-31 16:49:28
标签:

    参考:http://www.dokuwiki.org/tips:htaccessauth

    在公司内部中,有时会使用基于Apache服务器的htaccess认证(HTTP Authentication)。那么怎样让DokuWiki使用htaccess作为认证方式呢?

    打开Apache的

    # File: .htaccess 
    AuthType Basic
    AuthName "DokuWiki"
    require valid-user
    

    安装DokuWiki的htaccess认证模块

    • 参考页面:http://www.dokuwiki.org/tips:htaccessauth
    • 下载地址:htaccessauth.zip
    unzip htaccessauth.zip
    cp htaccess.class.php  $dokuwiki_dir/inc/auth/
    cp htusers.auth.php    $dokuwiki_dir/conf/
    
    ### Edit $dokuwiki_dir/conf/local.protected.php
    
    $conf['htaccess_defaultgrp'] = 'user';
    $conf['htaccess_domain'] = “example.com”; 
    if (isset($_SERVER['PHP_AUTH_USER']) && !isset($_SESSION[$conf['title']]['auth']['info'])) 
        $_REQUEST['u'] = $_SERVER['PHP_AUTH_USER'];  
    
    # other suggested setting
    $conf['useacl']       = 1;           // this enables the ACL feature
    $conf['openregister'] = 0; 
    
    标签:

      分享到:
      comments powered by Disqus

      18/20ms