0

I always set my file permissions under the templates_c folder like in the Question to username:www-data and the permissions to 770. It runs fine on other systems, but I have a system which is only runs fine until there appear more cached stuff in the folder. The new files have strange combinations of ownership like username:username or www-data:www-data. Also they have the wrong permissions set. The username:username get 664 the www-data:www-data 644.

Now i tried to set the ownership of my folder to username:www-data with 770. Then webinterface of civicrm doesnt work. If i set the folder to www-data:www-data the system works, but the civicrm related cronjobs from username doesnt work.

Is there a superior file permission i dont see here, but is correct on my other systems? I always do the same stuff like in the link suggested when i set my permissions. I cant get to the point why the system has this strange behavior, all because of a template cache.

5
  • You might have a cron script that runs as username. If possible set the cron script to run as www-data.
    – Demerit
    Commented Oct 15, 2022 at 12:07
  • But isnt the www-data the apache-"user"? The username is the "owner" and "manager" of the crm. Why cant i logically divide the roles like that?
    – gzwg
    Commented Oct 16, 2022 at 10:06
  • The www-data apache "user" needs write access to everything in templates_c. If username creates a file/folder in there and www-data doesn't also have write access to it, you get fails.
    – Demerit
    Commented Oct 16, 2022 at 18:02
  • Yes, but thats the reason why i set the whole folder to username:www-data and the permissions to 770 so that when there is a new folder or file, it doesnt have to be a problem, or do i understand you wrong?
    – gzwg
    Commented Oct 17, 2022 at 7:36
  • For that to work though you would need to put the two users in the same group, or start messing with umask and setuid bits. Currently and NEW subfolders/files created by one user will not be writable by the other.
    – Demerit
    Commented Oct 17, 2022 at 12:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.