我試圖把驗證用於訪問的Apache2我的文檔根目錄中允許... 這裏是我的配置文件的.htaccess:爲了不在這裏
<VirtualHost *:80>
ServerAdmin [email protected]
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>
這裏是我的.htaccess文件在/ home /用戶/工作區文件夾:
<FilesMatch >
.....
</FilesMatch>
AuthType Basic
AuthName "MY ZONE"
#AuthBasicProvider file
AuthUserFile /home/vishu/workspace/passwordfile
AuthGroupFile /dev/null
Require valid-user
.....
...
阿帕奇給.htaccess:order not allowed here
錯誤,我收到來自瀏覽器的500錯誤。
我的問題是'要求不here'允許的,我並沒有意識到,'AuthConfig'是你需要設置如果你希望'.htaccess'文件能夠添加'Require'指令,可以添加到'AllowOverride'中。 –