我正在尝试将身份验证用于访问apache2中的文档根目录...这是我的配置文件
<VirtualHost *:80>
ServerAdmin webmaster@localhost
AccessFileName .htaccess
DocumentRoot /home/user/workspace
<Directory />
Options FollowSymLinks
AllowOverride None.htaccess
</Directory>
<Directory /home/vishu/workspace>
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
allow from all
</Directory>
......
......
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
这是/ home/user/workspace文件夹中的.htaccess文件:
<FilesMatch >
.....
</FilesMatch>
AuthType Basic
AuthName "MY ZONE"
#AuthBasicProvider file
AuthUserFile /home/vishu/workspace/passwordfile
AuthGroupFile /dev/null
Require valid-user
.....
...
Run Code Online (Sandbox Code Playgroud)
Apache .htaccess:order not allowed here出错,我从浏览器收到500错误.