2013-01-10 17 views
3

我試圖把驗證用於訪問的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錯誤。

回答

1

我不知道爲什麼你得到「'爲了這裏不允許‘’」看到,因爲你沒有在你的htaccess文件的Order指令,但我猜它可能是一些在你的/目錄,因爲你的覆蓋設置爲None

您可以嘗試在<Directory />容器添加覆蓋,是這樣的:

AllowOverride Limit 

爲每Apache documentation

1

我有這個同樣的問題,這是由於我的主機沒」上的限制允許我添加任何'訂單允許,拒絕'或其他事情。所以基本上我不得不將所有不允許的東西評論出來才能使它起作用。

如果這對您是個問題,可能需要切換主機。

5

看看你的AllowOverride指令。我有這個問題太多,但對我來說,下面的配置工作:

<Directory /var/www/> 
    Options Indexes FollowSymLinks 
    AllowOverride AuthConfig Limit 
    Require all granted 
</Directory> 

AllowOverride All可能也行,只是取決於你要多少允許。

退房更多信息這兩個環節:

https://drupal.org/node/10133

http://httpd.apache.org/docs/2.2/howto/auth.html

+0

我的問題是'要求不here'允許的,我並沒有意識到,'AuthConfig'是你需要設置如果你希望'.htaccess'文件能夠添加'Require'指令,可以添加到'AllowOverride'中。 –

相關問題