Created a development/test server from an existing site, struggling with permissions errors on Cent OS 6 server I am hoping a I can get a little help on a problem that I continually struggle with and that seems to impact a number of places on a site that I have copied over from a production version.

So I have a site for which I created a development environment for on an Amazon EC2 instance (original site is not on Amazon EC2). So far everything is loading up and showing for the most part. But it is becoming clear that in handling administrative tasks I am running into file permission problems.

For instance, If I go to *Administrator > Site Building > Themes > My Custom Theme* to configure the favicon, I get the error:


  The directory sites/default/files is not writable


I have tried chmod 775 and that does not work. If I do chmod 777 the css files don't load and the site is without styles. I have tried chown 6226 (which seems to be the default user from when I did a fresh install of drupal 6.20 on the new server). And have tried chown ec2-user (the default ec2 instance user) as well as chown the user from the production server (for which there is a user with the same name on the new server).

So far nothing works and the directory is still not writeable. Where can I go just to see what the new server expects for write permissions to the files it needs permissions to access? These are not problems on the production server.
The best to fix the permission issue is run the fix-permission script available at https://drupal.org/node/244924 

First download the script from here and than run the script as:

sudo bash fix-permissions.sh your/drupal/path your_user_name


Note: The server group name is assumed "www-data", if it differs modify it in the script code

Drupal official doc for file permission is available at https://drupal.org/node/244924



Generally Recommended Permissions for Drupal Files and Folders is following:

drupal/sites/default                                        750
drupal/sites/default/files (including sub folders &amp; files)  755 or 770 *
drupal/sites/default/settings.php                           400 or 440 *
drupal/sites/default/default.settings.php                   400 or 440 *
drupal/sites/all/themes (including sub folders &amp; files)     755
drupal/sites/all/modules (including sub folders &amp; files)    755


* depends on system setup. Some extra modules and/or server rules may require different permissions.