Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to update the file permissions for SuiteCRM.

I need to run the following code in GNU bash, but I cannot figure out the correct syntax to list the file permissions.

I am the root user

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

Version is GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) correct syntax for file permissions

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
233 views
Welcome To Ask or Share your Answers For Others

1 Answer

For SuiteCRM this is what I do for resetting permissions (you have to be root before executing)

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 .

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 .

The first line makes sure all files are 644 and all folders are 755 just to make sure you don't have weird permissions.

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 :)

EDIT: Excluded the vendor folder which has its own file permissions needs (bin folder has executable files)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...