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.

I need to set up a Apache server configuration for some client sites that run under the same Ubuntu 9.10 machine. All sites are allowed to run PHP, Python and Ruby on Rails. I do not control the source code of these sites and so I need to set up a filter in order to prevent one user to reach files on another users account.



If I run a script to list files in "/" from one account, I can browse some files and directories in the actual server root. I want to set the root for each account to /var/usersite.com/www/ instead so that listing files in "/" shows the files in the client's root.



How is this most easily configured?



Cheers!


/Christoffer

share|improve this question

2 Answers 2

You probably want to take a look at this wiki:

https://help.ubuntu.com/community/DebootstrapChroot

If you just want to have files unreachable/unseen then why don't you just set the files to 700?

share|improve this answer
    
700 won't work because the webserver will need permissions to access the directory. –  jneves May 11 '10 at 21:31

I would set up a separate virtual server for each site, each with it's own DirectoryRoot such as /var/usersite.com/www/ Then, to make sure that only the user has access, I would require authentication to view the site. This can all be done in the httpd.conf file.

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.