[问题]apache2 的.htaccess认证问题

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
niedhui
帖子: 11
注册时间: 2007-04-26 23:12

[问题]apache2 的.htaccess认证问题

#1

帖子 niedhui » 2008-04-20 16:11

小弟刚刚学配置apache2.2.4的服务噐,在设定.htaccess文件的时候,浏览网页时提示输入用户名和密码,但我怎么输入都不对,各位大哥帮看看可能是哪里的问题:
httpd.conf的配置:
Alias /test "/home/test/public_html"
<Directory "/home/test/public_html">
#Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

userdir.conf里面的内容是:

<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
</Directory>
</IfModule>


/home/test/public_html目录下的.htaccess文件内容:
AuthName "Protect test by .htaccess"
AuthType Basic
AuthUserFile /var/www/apache.passwd
Require testadmin admin admin2

/var/www/apache.passwd文件的内容:
testadmin:UvHffvMiR.7qw
admin:Z7DWFBZmV94Gk
admin2:4QSv63FMV8sdc

在error.log文件中有:
access to /test/index.html failed, reason: require directives present and no Authoritative handler.


当浏览http://localhost/test时,会弹出输入用户名和密码,但怎么输都不对,可能是哪里的问题?
magiciany
帖子: 393
注册时间: 2007-04-25 11:49

#2

帖子 magiciany » 2008-04-27 3:10

前几天刚做个这个。。。。记得只生成了密码文件,然后在目录下放了个.htaccess,然后httpd.conf里改了一行就能用了。具体的忘了

你吧test/index.html重命名看下呢?
回复