Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

On my VPS i've installed debian, apache+php.
I have 2 users: foo and bar.
Apache is configured to execute php files from /home/foo/htdocs.

I created dir: /home/foo/htdocs/bar/ and made it home dir for user bar. Hover, I need to make a restriction: bar can't read, write or executre any files outside his own dir, but Apache has to be able execute all php files from /htdocs.

I tried to chown the bar dir only for user bar, also experimented a lot with chmod but without a result so far.

If there's any better way to satisfy my needs don't hesitate to write about it.

Thanks in advance

share|improve this question

It would be a lot easier to put bar's web-facing files in /home/bar/htdocs/ and then adding the following line to your httpd.conf to make it accessible at

Alias /bar /home/bar/htdocs

Be sure to configure a <Directory> section appropriately too.

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.