php - Hubzilla 无法启动:/store/[data]/smarty3 必须可由网络服务器写入
问题描述
我按照手册说明在此处设置 Hubzilla。
https://project.hubzilla.org/help/en/admin/administrator_guide#Manual_Installation
我运行了命令
chmod -R 777 store
但是当我在浏览器中查看页面时,它仍然给我这个错误。
ERROR: folder /var/www/html//store/[data]/smarty3 must be writable by webserver.
我试着把chown -R apache:apache store
它chmod o-w -R store
收紧,但没有用,所以我又跑chmod -R 777 store
了。这里是权限。
[root@fsphub html]# ls -ld store
drwxrwxrwx. 3 apache apache 20 Dec 1 22:08 store
[root@fsphub html]# ls -lR store
store:
total 0
drwxrwxrwx. 3 apache apache 21 Dec 1 22:08 [data]
store/[data]:
total 0
drwxrwxrwx. 2 apache apache 6 Dec 1 22:08 smarty3
store/[data]/smarty3:
total 0
Apache 以apache
.
[root@fsphub html]# ps -ef | grep http
root 16997 1 0 21:47 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 16998 16997 0 21:47 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
有什么问题?
PHP 7.2.12
解决方案
这是由于 SELinux 正在运行。https://wiki.centos.org/HowTos/SELinux
# sestatus
SELinux status: enabled
Current mode: enforcing
# sealert -a /var/log/audit/audit.log
SELinux 正在阻止 /usr/sbin/httpd 对 smarty3 目录进行写访问。
***** 插件 httpd_write_content(92.2 置信度)建议 ***************
如果你想允许 httpd 对 smarty3 目录有写访问权限 那么你需要更改 'smarty3' 上的标签
# semanage fcontext -a -t httpd_sys_rw_content_t 'smarty3'
# restorecon -v 'smarty3'
原始审计消息
type=AVC msg=audit(1543792561.65:60034):avc: denied { write } for pid=21907 comm="httpd" name="smarty3" dev="vda1" ino=621797 scontext=system_u:system_r:httpd_t :s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=dir
# ls -lZd store/\[data\]/smarty3/
drwxrwxrwx. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 store/[data]/smarty3/
所以我跑了
# semanage fcontext -a -t httpd_sys_rw_content_t store/\[data\]/smarty3/
# restorecon -v store/\[data\]/smarty3/
但这只是没有用,所以我用
setenforce 0
将模式更改为permissive
.
推荐阅读
- javascript - 在网格中向下滑动 div 的底部,而不滑动整行。
- c# - 提供数据到
xml xml 对于 C# Web 服务 - java - 更改抽屉布局项目
- android - 在黑白之间切换状态栏文本颜色
- css - 结合 vue 材料和 vue cli webpack 模板时,表单元素显示为透明
- angular - Angular 6 - 从 ReactiveForm 访问数组中的数组
- android - 启用在地图框上显示高尔夫球车路径以及行驶路径
- amazon-web-services - 我的应用所在的区域对 Amazon SES 免费套餐是否重要?
- reflection - 我可以在纯 Kotlin 中通过类名实例化一个对象吗
- assembly - 如何使用 malloc 空间执行代码而不是存储数据