Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

The mode for both these directories is 755. I'd like to restrict permissions to 754. But if I do so, I'm thinking the apache www-data instance won't be able to access the directories to serve the contained files.

  1. Is there a canonical mode for these directories. 2. What's a good way to provide the apache instance access: through creating some sort of group?
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Do not change the chmod for /varas this should remain default.

Apache runs on the usergroup www-data so /var/www should have the owner has www-data and not root, if this is the case then 754 is absolutely fine.

This may help:

chown www-data:www-data /var/www
chmod -R 754 /var/www

Normally this is set-up for you if you used an installer such as apt-get when installing Apache or nginx.

share|improve this answer

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.