htaccess pcfg_openfile:无法检查htaccess文件,确保它是可读的并且'/files/domain.com/public_html/images/'是可执行的

tes*_*mus 21 linux apache security permissions nginx

今天我将我的图像从一台服务器迁移到另一台服务器,并面临一个奇怪的许可问题

[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
Run Code Online (Sandbox Code Playgroud)

我试过的:

    chmod -R 777 root_dir
    restorecon -r
    disable selinux
    Chown -R root:root root_dir
Run Code Online (Sandbox Code Playgroud)

Ali*_*Ali 27

今天我遇到了这个问题.我将public_html从旧驱动器转移到新驱动器,并按如下方式调用:

chown -R owner:owner public_html
Run Code Online (Sandbox Code Playgroud)

这对于public_html中的子目录和文件是正确的,但是public_html的用户必须是nobody,所以apache可以检查它的内容,所以这解决了我的问题:

chown owner:nobody public_html
Run Code Online (Sandbox Code Playgroud)

注意:owner是用户(例如web1)

  • Plesk的情况类似:`/ var/www/vhosts/example.com`文件夹必须由`user:psaserv`拥有,但其中的所有内容都由`user:psacln`拥有. (7认同)

shi*_*oid 13

我有同样的问题.对我来说,这是SeLinux(CentOS 7)的一个问题.

这个对我有用:

$ setsebool -P httpd_enable_homedirs true
$ chcon -R -t httpd_sys_content_t /var/www/html/
Run Code Online (Sandbox Code Playgroud)

请注意,您应将上述内容更改为/var/www/html/适当的目录.