SuiteCRM - 修复文件权限 [英] SuiteCRM - fix file permissions
问题描述
我正在尝试更新 SuiteCRM 的文件权限.
I am trying to update the file permissions for SuiteCRM.
我需要在 GNU bash 中运行以下代码,但我无法找出列出文件权限的正确语法.
I need to run the following code in GNU bash, but I cannot figure out the correct syntax to list the file permissions.
我是root用户
sudo chown -R www-data:www-data .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload
sudo chmod 775 config_override.php 2>/dev/null
版本是 GNU bash,版本 4.2.46(2)-release (x86_64-redhat-linux-gnu) 正确的文件权限语法
Version is GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) correct syntax for file permissions
推荐答案
对于 SuiteCRM,这是我为重置权限所做的事情(您必须是 root 才能执行)
For SuiteCRM this is what I do for resetting permissions (you have to be root before executing)
请根据您的 Web 服务器用户进行调整(此用户适用于 ubuntu)
Please adjust to your web server user (this one is for ubuntu )
find . -type d ! -path ./vendor -exec chmod 0755 {} \; && find . -type f ! -path ./vendor -exec chmod 0644 {} \;
chmod -R 775 cache custom modules themes data upload config_override.php config.php
chown -R www-data:www-data .
对于 redhat,apache 网络服务器通常以 apache
用户身份运行,因此您应该运行:
For redhat the apache webserver usually runs as apache
user so you should run:
find . -type d ! -path ./vendor -exec chmod 0755 {} \; && find . -type f ! -path ./vendor -exec chmod 0644 {} \;
chmod -R 775 cache custom modules themes data upload config_override.php config.php
chown -R apache:apache .
第一行确保所有文件都是 644
并且所有文件夹都是 755
只是为了确保您没有奇怪的权限.
The first line makes sure all files are 644
and all folders are 755
just to make sure you don't have weird permissions.
最后但并非最不重要的一点,只有在有人拥有 SuPHP 的情况下,您才需要为 redhat 运行 chown apache.nobody ./
和 chown www-data.nobody ./
code> 因为 apache 通常以无人身份运行并且需要访问根文件夹 + SuPHP 可能会抱怨某些文件夹的组写入权限,因此请调整 :)
Last but not least, ONLY in the case that someone has SuPHP you will need to run chown apache.nobody ./
for redhat and chown www-data.nobody ./
as apache usually runs as nobody and needs access to the root folder + SuPHP might complain of group write permissions on some folders so adjust :)
排除了有自己文件权限需求的供应商文件夹(bin文件夹有可执行文件)
Excluded the vendor folder which has its own file permissions needs (bin folder has executable files)
这篇关于SuiteCRM - 修复文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!