Posted by Rick Hood on November 25, 2012 at 10:36pm
New install of Drupal 7:
It wanted me to make the files directory writable, so I chmod 777 -R files. But that worries me as being insecure.
ls -al gives me the following:
-rw-rw-r-- 1 username username 23197 Nov 24 14:16 default.settings.php
drwxrwxrwx 3 username username 4096 Nov 25 17:16 files
-rw-r--r-- 1 username username 23507 Nov 24 15:36 settings.php
...where username is my ssh username.
Is this the above secure? The "w" for files seems bad, but I don't understand enough about Linux groups, etc.
Thanks!
Comments
If you've finished installing
If you've finished installing Drupal, settings.php should be 444.
Jaypan We build websites
=-=
if you are nervous about 777 you can try 775 and 755, though if neither of these work 777 is your only option.
Drupal directories should be
Drupal directories should be 755.
Jaypan We build websites
Thanks... Neither 775 nor
Thanks...
Neither 775 nor 755 works; I get the: "The directory sites/default/files exists but is not writable and could not be made writable" notice from Drupal. Only 777 works.
I think this may have to do with ownership, where owner and group are both my username - I think Drupal needs the group or owner to be Apache?
Maybe I need to: chown username:apache files ?? ...don't know enough about what owner:group should be.
Found the fix here:
Found the fix here: http://drupal.org/node/394704
user of the files folder needs to be www-data so this fixes it:
sudo chown -R www-data sites/default/filessudo chmod -R 0700 sites/default/filesNope this is better:
sudo chgrp -R www-data sites/default/files
sudo chmod -R 775 sites/default/files
1. Change the group to www-data not the owner.
2. Give owner and group 7, but public 5.
...otherwise I have to sudo to cd into files.
so now looks like this:
drwxr-xr-x 3 username www-data 4096 Nov 25 17:16 files
(username is what I ssh with)
For anyone who comes across
For anyone who comes across this afterwards, the user and group are dependent upon the system, and the group may or may not be www-data, so be careful with this.
Jaypan We build websites