Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am getting a 403 forbidden when trying to view a rails website, and I am guessing this is a permissions issue.

All the files and folders are owned by the user I logged into the computer with, and from what I understand Nginx runs under the www-data account.

How can I recursively update all files/folders to use the www-data account (and group correct?).

thanks!

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Use chown - if your data is stored in, for example, /var/www then

cd /var
chown -R www-data:www-data www

should do the trick.

share|improve this answer
1  
I recommend against getting used to using directory names relative to the current working directory when there are good options. E.g. 'chown .... /var/www' instead. This can save you some trouble if you get in the habit (e.g. 'cd / home/user ; rm ` instead of 'rm / home/user/' –  Slartibartfast Nov 29 '10 at 1:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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