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



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.

  • 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

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.