Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?).


share|improve this question
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
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


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.