Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

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

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
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


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.