主要有如下幾個緣由:linux
1475 [Thu Jun 20 16:39:43.673203 2019] [core:crit] [pid 43885] (13)Permission denied: [client 112.93.21.21:14290] AH00529: /home/hello/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/hello/' is executable
須要給目錄加上可讀可執行權限,如apache
chmod o+x /home/hello chmod o+r /home/hello
如這樣配置虛擬目錄:ide
Alias /virtualdirectory/ "D:/user/www/virtual/" <Directory "D:/user/www/virtual/"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all </Directory>
apache默認配置是比較嚴格的,不容許未通過驗證去訪問目錄,這個能夠在httpd.conf
找到該配置:ui
<Directory> AllowOverride none Require all denied </Directory>
解決方法:給虛擬目錄增長 require all granted
指令,即上述配置變成:日誌
Alias /virtualdirectory/ "D:/user/www/virtual/" <Directory "D:/user/www/virtual/"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory>
主要是 rehat系列發行版,該設定比較煩人,不想配置的直接關掉:code
查看SELinux狀態:ci
一、/usr/sbin/sestatus -v ##若是SELinux status參數爲enabled即爲開啓狀態get
SELinux status: enabledit
二、getenforce ##也能夠用這個命令檢查io
關閉SELinux:
一、臨時關閉(不用重啓機器):
setenforce 0 ##設置SELinux 成爲permissive模式
二、修改配置文件須要重啓機器:
修改/etc/selinux/config 文件
將SELINUX=enforcing改成SELINUX=disabled
重啓機器便可