更新我想我们已经解决了这个问题。 这个问题似乎是/ modsec_storage目录的SELinux上下文types的值不正确的结果。
但是,我们仍然不确定,因为虽然在更改SELinux上下文types值后,Apache能够在全局和ip集合(global.dir / global.pag和ip.dir / ip)的目录中创build文件。 pag),新文件仍然有零字节。
我是ModSecurity的新手,不确定这些文件是否为空,因为configuration有问题,或者ModSecurity只是简单地确定在每个事务结束后不需要永久存储IP地址。
任何人都可以在这里提供指导?
我最近在我们的生产服务器上安装了ModSecurity(v2.5.12 / CRS v2.0.8),除了这些写入Apache错误日志的错误之外,一切都很好。
Failed to access DBM file "/modsec_storage/global": Permission denied [hostname "www.internationalstudent.com"] [uri "/includes/soc_bookmarks/images/delicious.png"] [unique_id "LZ6jc38AAAEAAFO6408AAABO"] Failed to access DBM file "/modsec_storage/ip": Permission denied [hostname "www.internationalstudent.com"] [uri "/includes/soc_bookmarks/images/delicious.png"] [unique_id "LZ6jc38AAAEAAFO6408AAABO"]
按照Ivan Ristic的ModSecurity手册中的文件权限设置说明,没有成功,我创build了/ modsec_storage目录,将所有者和组设置为apache,并将目录权限recursion设置为777。
但是,ModSecurity仍然报告相同的权限错误,所以我很难过。 谁能告诉我如何解决这个问题?
尝试setenforce 0
这很可能是一个SELinux问题,在这种情况下,我相信你可能需要为这个文件夹分配一个httpd上下文。 如果上述修复它,你可以尝试:
chcon -R system_u:object_r:httpd_sys_content_t /modsec_storage
根文件夹下是文件夹modesec_storage?