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.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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

chmod 755 /var/www

should solve your problem.

share|improve this answer
    
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
    
Thank you! This helped a lot –  CP510 Jun 26 '13 at 13:20
add comment

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.