I've installed Xenforo on my digitalocean VPS running CentOS 7, I get this error as soon as I open the web page. `The following errors occurred while verifying that your server can run XenForo:
The directory /var/www/html/data must be writable. Please change the permissions on this directory to be world writable (chmod 0777). If the directory does not exist, please create it.
The directory /var/www/html/internal_data must be writable. Please change the permissions on this directory to be world writable (chmod 0777). If the directory does not exist, please create it.
Please correct these errors and try again.
How would I change the permission for the directory so it can be world writable?
答案 0 :(得分:0)
基本上data
和internal_data
是运行Xenforo的用户应该能够在其中写入的目录,因为它们将包含附件,头像和其他文件。
通常在组www-data
中,在Apache或Nginx上运行PHP的用户是www-data
(该用户和组具有相同的名称),因此您要做的就是让该用户在{ {1}}和data
:
internal_data
如果您要按照字面上的错误消息中的建议进行操作,则可以执行以下操作:
chown -R www-data.www-data /var/www/html/data /var/www/html/internal_data
但是,正如其他人所评论的那样,这种方法更加不安全,因为它将允许系统中的任何用户写入chmod -R 0777 /var/www/html/data /var/www/html/internal_data
和data
目录。
答案 1 :(得分:0)
这是根据CentMinMod和Xenforo documentation在CentOS上的Nginx上的Xenforo 2的建议。必须这样做,否则Xenforo2无法正常工作。我已经在多个站点上使用了它,没有问题。为了安全起见,请先备份。
find /home/nginx/domains/domain.com/public/ -type f -print0 | xargs -0 chmod 0644;
find /home/nginx/domains/domain.com/public/ -type d -print0 | xargs -0 chmod 0755;
find /home/nginx/domains/domain.com/public/internal_data/ -type f -print0 | xargs -0 chmod 0777;
find /home/nginx/domains/domain.com/public/data/ -type f -print0 | xargs -0 chmod 0777;
find /home/nginx/domains/domain.com/public/internal_data/ -type d -print0 | xargs -0 chmod 0777;
find /home/nginx/domains/domain.com/public/data/ -type d -print0 | xargs -0 chmod 0777;
chmod 0750 /home/nginx/domains/domain.com/public;