Any suggestions for setting files directory permissions with Aegir?

Events happening in the community are now at Drupal community events on www.drupal.org.
bryanhirsch's picture

One of my platforms requires the files directory to be owned by www-data. There must be a hook somewhere that will let me automate running this every time I create a new installation of this particular platform:

$ cd /var/aegir/platforms/myplatform/sites/mynewinstallation.com/
$ chown -R www-data.www-data files/

Any suggestions?

Comments

What is the reason?

timwood's picture

Why does the files directory needs to be owned by user www-data? I think I went ahead and added the Aegir user to the www-data system group. Maybe that would help?

If you setup Aegir correctly,

mig5's picture

If you setup Aegir correctly, ownership of the files directory to be that of www-data is not needed - as timwood says, the aegir user gets added to the www-data group, and we set the group on the files dir to be www-data with writable permissions. That is sufficient for Apache to write files to the directory. Every time you verify a platform or site it will go and reset those permissions.

If your platform specifically expects the owner of the files dir to be www-data, I'd consider that a poor design choice: just checking that the directory is writable by www-data should be sufficient.

Thanks Mig5 and timwood. I

bryanhirsch's picture

Thanks Mig5 and timwood. I certainly don't want to be making any poor design choices.

And your totally right. Aegir being part of the www-data group does what I need. I was mis-diagnosing my problem. I thought my module was not being allowed to write CSS files in my files directory without being the owner of files. But now I see that with Aegir being a member of the www-data group, the files are getting written just fine.

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: