简体   繁体   English

在本地环境中为drupal 8设置目录权限

[英]Directory permission setup for drupal 8 in local environment

I've read through the official docs of drupal 8 and still don't get the idea of how to setup correct permission of the folders and files. 我已经阅读了Drupal 8的官方文档,但仍然不了解如何设置文件夹和文件的正确权限。
screenshote

When we give 777 permission it might work but it's not an elegant way to do so, is there any easy way to setup permission. 当我们授予777许可时,它可能会起作用,但是这样做不是一个好方法,有没有简便的设置许可的方法。 I'm using Ubuntu 16.04. 我正在使用Ubuntu 16.04。

If your system is running with an enforced security policy (SELinux) you may have to set the appropriate rules for httpd/drupal to run properly. 如果您的系统使用强制性安全策略(SELinux)运行,则可能必须为httpd / drupal设置适当的规则才能正常运行。

Other than that, following requirements as specified in INSTALL.TXT should be enough. 除此之外,按照INSTALL.TXT中指定的要求就足够了。

Missing files directory : 缺少文件目录:

mkdir sites/default/files
chmod a+w sites/default/files

You can also set permissions on sites/default/ as well so that your web server is able to create directories under this path : 您还可以在sites/default/上设置权限,以便您的Web服务器能够在以下路径下创建目录:

chmod a+w sites/default

Missing settings.php : 缺少settings.php:

cp sites/default/default.settings.php sites/default/settings.php

Make it writable for the installation : 使安装可写:

chmod a+w sites/default/settings.php

And once the installation is finished, set the permissions back : 安装完成后,将权限设置回:

chmod go-w sites/default/settings.php

Multisite : 多站点:

For a multisite installation you would replace default by the site directory : 对于多站点安装,您将default替换为站点目录:

mkdir sites/example.com/files
chmod a+w sites/example.com/files
cp sites/default/defaults.settings.php sites/example.com/settings.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM