微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

在数字签名服务器上存储私钥的位置?

.htaccess拒绝访问特定的文件? 超过一个

未设置创build文件的SMACK标签

如何使用Windows安全描述符来防止执行其他应用程序?

尝试用Peach写一个简单的模糊器来检测缓冲区溢出

敏感的variables使用后明确清除/清零?

PAMauthentication问题

为什么“本地启动”认允许外部服务器,但“本地激活”不是?

set-uid的安全问题以及ELF中INTERP(dynamic链接器)的相对path

Active Directory如何在设置新密码时比较用户以前的密码

今天我遇到了这个问题。 我把旧的驱动器中的public_html转移到了新的驱动器上,像这样:

chown -R owner:owner public_html

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

chown owner:nobody public_html

注意: 所有者用户(例如web1)

TL; DR:

sudo chmod a+rx /var{,/services{,/web{,/web-folder}}}; find /var/services/web/web-folder -type d -exec sudo chmod a+rx {} +;

您需要确定Web服务器的目录及其所有父目录是可读可执行的(可执行性是打开目录所必需的)。 您可以通过使Web服务器用户成为拥有者并使用户权限(EG: chown apache <dir>; chmod u+rx <dir>; ),或者通过使组成为Web服务器组(EG: chgrp apache <dir>; chmod g+rx <dir>; ),或者将世界的perms设置为(EG: chmod o+rx <dir>; )。

打开你的httpd.conf文件并将.htaccess文件中的全部拒绝从全部改为允许

以下行防止.htaccess和.htpasswd文件

由Web客户端查看。

<FileMatch "^.ht"> Order allow,dey Allow from all </FileMatch>

解决了我的问题

当我检查httpd/user-error_log ,它给

[Fri Jan 09 18:58:08 2015] [crit] [client 192.168.1.xxx] (13)Permission denied: /var/services/web/web-folder/.htaccess pcfg_openfile: unable to check htaccess file,ensure it is readable

chmod 755没有解决问题。 下面的命令是适合我的。 我使用http,因为它是Synology DSM 5.1-5021中使用的apache用户和组cd / var / services / web chown http:http web-folder

apache httpd.conf @ /etc/httpd/conf/httpd.conf

有关5.0中新的更改Apache / Webserver限制的更多细节

我正在使用Plesk onyx,并且得到了相同的错误信息,我只是将文件夹权限更改为775,并且对我有用。

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

这个对我有用:

$ setsebool -P httpd_enable_homedirs true $ chcon -R -t httpd_sys_content_t /var/www/html/

请注意,您应该将上面的/var/www/html/更改为适当的目录。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐