Permissions

Thank you. I changed this but when I delete sugarcrm.log file, SugarCRM create new log file with 0644 instead of 0755

Hmmmā€¦ What did I do wrong?

ā€¦ thatā€™s the point: SugarCRM continuosly messes up permissions! So you have to watch them.

Possibly you should have deleted the entire contents of the cache folder (not the folder itself) and run a quick repair and rebuild before deleting the log file.

I have created a php script for me to reset the permissions to the whole SuiteCRM folders to 775 and 755 accordingly. This script executes in less than 10 seconds and I run it when I touch something in Admin (eg add new things) as well as in a nightly cron job.

Oh, Sugar is so messyā€¦ Than this changes in config.php and in include/utils.php are not very reliable

In this case it is best for me to periodically run permission changes:

sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

I decided to use this

ā€˜default_permissionsā€™ =>
array (
ā€˜dir_modeā€™ => 1517,
ā€˜file_modeā€™ => 493,

Is this ok? Or I need some other values to use for 755 on files and directories?

And I will periodically run permission changes:

sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

Will what you think about this?

Hi there,

Permissions vary between different hosting solutions. Our recommended settings are:

ā€˜default_permissionsā€™ =>
array (
ā€˜dir_modeā€™ => 1517,
ā€˜file_modeā€™ => 420,
ā€˜userā€™ => ā€˜youruserā€™, // you must replace with the actual value
ā€˜groupā€™ => ā€˜yourgroupā€™, // you must replace with the actual value
),

Then running the following commmands inside your SuiteCRM directory:

sudo chown -R youruser:yourgroup .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

What are the issues you are experiencing?

Thanks,

Will.

Ok, I will try with your recommended settings.

Lot of issues Iā€™m experiencing with SuiteCRM. You can see all my posts with errors problem

Iā€™m on SiteGround hosting and now I will try Hostgator.

Do you have any recommendation for shared hosting where SuiteCRM will work without problems?
I know that you offer hosting but it is too expensive for my little statup

Will please help me about on thing more.

Iā€™m now on VPS and should I use ā€œapacheā€ for user and group

ā€˜default_permissionsā€™ =>
array (
ā€˜dir_modeā€™ => 1517,
ā€˜file_modeā€™ => 420,
ā€˜userā€™ => ā€˜[color=#ff0000]apache[/color]ā€™,
ā€˜groupā€™ => ā€˜[color=#ff0000]apache[/color]ā€™,
),

amariussi, can you please send me that php script?

Nevals, any luck w/your user & group settings?

Hello Dusza,

I really donā€™t know :slight_smile:

I set permissions in accordance with the Willā€™s instructions and each time when I change something in SuiteCRM Admin after that I run commands:

sudo chown -R youruser:yourgroup .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

For now I have no problems with permissions

Hi Amariussi, would you mind sending me this script, it would really help me, Iā€™m not much of a programmer so wouldnā€™t be able to make one myself but I can implement one. Can you also explain what ā€œuserā€ and ā€œgroupā€ means in relation to a hosted platform.

Thanks in advance.

As per your request I am attaching a script that changes permissions to your SuiteCRM files and folders.
The script doesnā€™t affect owner or group.

To run the script you have to place it in the SuiteCRM root folder and run it as a web application. For example: www.mysite.com/suitecrmrootfolder/chperms.php

(where you have to change ā€œmysite.comā€ to the real domain of your site and ā€œsuitecrmrootfolderā€ to the path to the suiteCRM root folder).

If you open the script you will see that it is a quick and dirty script which could be improved in programming style and user interface. In any case it works fine.
If you want to see what it does you have to change the first line:

$chmod_debug_mode = FALSE;

to:

$chmod_debug_mode = TRUE;

However I do not recommend it because the script will become very slow (instead of a few seconds it will take several minutes)

You may also change the permissions it sets by editing the $change_folders arrays. Currently it sets everything to 755 except the following folders: cache, custom, data, modules, themes, upload and the file config_override.php, which it all sets to 775.

Personally I have set a cronjob that runs the script once every hour. I cannot recommend any usage but thatā€™s the way I use it.

Additionally I run it before and after everytime I have to use the admin part of the SuiteCRM, or if I have to modify some custom code, just in caseā€¦

I hope you will find it useful.

A.

Thank you Amariussi, sorry I didnā€™t acknowledge sooner. Things were hectic around that time, I am doing a fresh install of Suitecrm so will try this out.

Have a good day. :slight_smile:

Hello.
I have 1 question and 1 proposal

Question: bellow there was assumption that in /include/utils.php there is bug. Where you have chown & chuser, but there must be user & group. So tell me please, that is bug or it must be like that?

Proposal Iā€™m addressing to SuiteCRM staff:
Could you please update your installation guide with permissions recommendations from that tread?

Iā€™m talking about:

  1. changes in /crmfolder/config.php
  2. changes in /crmfolder/include/utils.php
  3. chmod -R 755 && chmod -R 775 cache custom modules themes data upload config_override.php

Up.
I still confused regarding the ā€˜bugā€™ that I mentioned in last post.

up

I was looking at include/utils.php and I think that those names are wrong, like amariussi said, but they donā€™t make any difference, because they are not used anywhere.

So if you have problems, thatā€™s not where theyā€™re coming from.

About the installation instructions, the difficulty is that different setups require different instructionsā€¦ and I donā€™t think anybody really knows what is best, people just take guesses and use very generous permissions to make sure they work. This is definitely not a good area of SugarCRM.

What specific problems are you having with permissions? Your cron jobs arenā€™t running as root, by any chance? That is known to break thingsā€¦

That link doesnā€™t work anymore. Would you mind to repost it please @amariussi?

You donā€™t need a script to reset permissions. If youā€™re breaking them, your doing something else wrong: typically, logging in and changing files as some other user (like root), or running the cron jobs as root, etc