douzhaolu4780 2018-12-01 22:41
浏览 56
已采纳

Hubzilla无法启动:/ store / [data] / smarty3必须可由Web服务器写入

I followed the manual instructions to set up Hubzilla here.

https://project.hubzilla.org/help/en/admin/administrator_guide#Manual_Installation

I ran the command

chmod -R 777 store

But it still gives me this error when I view the page in the browser.

ERROR: folder /var/www/html//store/[data]/smarty3 must be writable by webserver.

I tried chown -R apache:apache store and chmod o-w -R store to tighten it up, but that didn't work so I just ran chmod -R 777 store again. Here are the permissions.

[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 is running as 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

What could be wrong?

PHP 7.2.12

  • 写回答

1条回答 默认 最新

  • duanguochong0397 2018-12-02 23:35
    关注

    It was due to SELinux being on. https://wiki.centos.org/HowTos/SELinux

    # sestatus
    SELinux status:                 enabled
    Current mode:                   enforcing
    
    # sealert -a /var/log/audit/audit.log
    

    SELinux is preventing /usr/sbin/httpd from write access on the directory smarty3.

    ***** Plugin httpd_write_content (92.2 confidence) suggests ***************

    If you want to allow httpd to have write access on the smarty3 directory Then you need to change the label on 'smarty3' Do
    # semanage fcontext -a -t httpd_sys_rw_content_t 'smarty3'
    # restorecon -v 'smarty3'

    Raw Audit Messages
    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/
    

    So I ran

    # semanage fcontext -a -t httpd_sys_rw_content_t store/\[data\]/smarty3/
    # restorecon -v store/\[data\]/smarty3/
    

    But that just didn't work so I used

    setenforce 0
    

    To change the mode to permissive.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教