2015-02-12 52 views
0

我有一個域名爲example.comexample.com鏈接到Tumblr博客。 sub.example.com指向我家的Ubuntu服務器的Apache服務器。我還在整個sub.example.com(也就是說,用戶可以在任何網頁使用httphttps之間選擇)中選擇性地啓用SSL。 sub.example.com/directory是.htaccess保護。我可以在http://sub.example.com/directory上很好地訪問目錄,但不能在https://sub.example.com/directory上訪問目錄。在https版本上,系統提示我輸入登錄信息。有一次,我進入了我的憑據,我得到這個錯誤:爲什麼.htaccess受保護的目錄在http上工作,但不在https上?

Error: File Not Found File Not Found.

我不知道發生了什麼錯誤。以下是完整的/var/www/html/directory/.htaccess文件和/etc/apache2/apache2.conf文件的選定部分。

的.htaccess:

AuthType Basic 
AuthName "Password Protected Area" 
AuthUserFile /var/www/.htpasswd 
Require valid-user 

apache2.conf:

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

我在Ubuntu 14.10和Apache 2.4.10

回答

0

請檢查下面

    這些步驟
  1. 確保您的HTTPS無需密碼即可使用。
  2. 確保您的.htaccess指向正確的.htpasswd路徑。
  3. 我覺得你的apache2.conf是好的,但檢查的配置文件中啓用了站點和CONF可用,如果有任何不正確的端口443
+0

HTTPS在受保護的目錄之外正常工作。 使用HTTP時可以通過密碼訪問該目錄。 由於HTTPS在'sub.example.com'上正常工作,因此SSL(假定)配置正確。 – 2015-02-12 16:40:44

0

像使用電腦這麼多東西,重新啓動固定我的問題。所以,我可能沒有重新啓動一些服務。

相關問題