0

Where do the image files reside? I have problems with the files, and the permissions. On my site, which runs Drupal-Commons, I cannot upload any image, either to a user or a group.

I was not able to fix it. First of all, regarding the user, my server works with the SETGID-bit enabled, and with the user vhost:vhost.
The bad is that every time I touch the chmod, I lose the setgit-bit; I tried changing it to 2777, and then all gets lost. I lose the style too.

What can I do? Can I upload the images manually, and store them into /home/vhost/WWW/schulcenter.org/sites/default/files?

2

setuid and setgid are for execution and not access control.

I can't comment on your exact problem, but when I move a site, I do

sudo find /path/to/site/default/files -type d -exec chmod 755 {} \;
sudo find /path/to/site/default/files -type f -exec chmod 644 {} \;
sudo find /path/to/private -type d -exec chmod 755 {} \;
sudo find /path/to/private -type f -exec chmod 644 {} \;
sudo chown -R apache.apache /path/to/docroot/site/default/files 
sudo chown -R apache.apache /path/to/private 

By default, files are in site/default/files but this location can vary for a few reasons

  • Admin setting for public files
  • Admin setting for private files
  • Whether the files use public or private
  • Whether you use the default location, or a site alias

and probably some others I can't think of. I suspect that your write errors will show up in your Apache error_log and you should also see what the status report (admin/reports/status) says.

Note that the private paths/settings are for Drupal 7 only, but the rest applies.

| improve this answer | |
  • hi MPD many manythanks - great input! BTW - do you do all your CHMOD-Things with Drush or with command-line itself!? – zero Mar 7 '12 at 0:24
  • Via bash itself. I don't think drush will do this. I actually have this as part of a deploy script that I use. – mpdonadio Mar 7 '12 at 0:25
  • thX for all the hints and advices especially the lines sudo chown -R /path/to/docroot/site/default/files apache.apache sudo chown -R /path/to/private apache.apache are very important. – zero Mar 7 '12 at 7:36
  • Just noticed that I had the args backwards on the chown lines. – mpdonadio Mar 7 '12 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.