0

With a fresh Ubuntu LAMP stack, I'm wondering why Apache serves up a Forbidden: Permission Denied error for my site.

Apache2 was setup with the default user/group www-data.

It's document root is /var/www

The permissions of that folder and its contents are 744 webmaster:www-data

The webmaster is just a sudo user for maintenance and has been added to the www-data group. But by all things, shouldn't this work?

1

A directory needs to have the execute permission set as well as the read permission. So

chmod 755 /var/www

should solve your problem.

  • Correct! That seems so strange to me. Isn't that a bit counter-productive to the whole security aspect? Like php exploits for shell and file uploads. – CP510 Jun 26 '13 at 12:55
  • Execute means different things for directoryes compared to files. For a directory, it means permission to enter the directory. For a file, it means permission to run the file as a program. – Jenny D Jun 26 '13 at 12:58
  • So safe to use it on directories but ok to exclude it on files? – CP510 Jun 26 '13 at 13:05
  • In this context and with these settings, yes. – Jenny D Jun 26 '13 at 13:10

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.