今天我將我的圖像從一臺服務器遷移到另一臺服務器,並面臨一個奇怪的許可問題htaccess pcfg_openfile:無法檢查htaccess文件,確保它是可讀的,並且'/files/domain.com/public_html/images/'是可執行的
[Mon Mar 25 08:42:23.676315 2013] [core:crit] [pid 15182] (13)Permission denied: [client 24.14.2.22:48113] AH00529: /files/domain.com/public_html/images/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/files/domain.com/public_html/images/' is executable, referer: http://domain.com.com/file.php
我已經試過:
chmod -R 777 root_dir
restorecon -r
disable selinux
Chown -R root:root root_dir
這是aufs中的一個錯誤,某些磁盤有錯誤的權限。 – teslasimus 2013-03-25 04:10:06
除了根目錄本身外,您還需要所有父目錄都可以從Web服務器的用戶讀取。 – 2013-03-25 11:04:56
chmod -R 777是一件非常危險的事情。它使每個目錄和文件世界都可寫和可執行。如果您想讓root_dir世界下的每個文件都可讀,並且root_dir世界可執行文件下的每個目錄(因此,如果名稱已知,所有人都可以訪問文件),則更安全的替代方案是find find_roles f -print0 | xargs -0 chmod o + r'; 'find root_dir -type d -print0 | xargs -0 chmod o + x' 如果您希望世界能夠在每個目錄上執行'ls'或'readdir',則替換o + rx。 – BertD 2015-07-08 22:29:39