LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Website Hosting and file/folder ownership (https://www.linuxquestions.org/questions/linux-security-4/website-hosting-and-file-folder-ownership-195027/)

vbfischer 06-18-2004 12:14 PM

Website Hosting and file/folder ownership
 
I am hosting several websites, mainly for friends, and friends of friends, etc. Each user has a login, so they can access their website files. I am having difficulties figuring out the best strategy for setting ownerships.

Lets say that Apache runs as the apache user. Is it best to set everything to owner:group apache:apache? I do this because its possible I have multiple users that want access to the same website. I add the users to the apache group, and make sure the files/folders are rwx for group.

I also create a mount point in their home directories to the website root so they can access the website structure without really leaving their chroot environment.

Any issues with this? Am I mucking things up?

Thanks in advance...

Donboy 06-18-2004 12:32 PM

You probably want to setup your apache to use suexec. This way, each virtual host will run as a particular user. So you setup a vhost for your user John Smith and put in the suexec directive telling that vhost to run as john:john.

This works out nicely for users who need to FTP to the server and upload their files. They will be logging into the server as "john" so the files that get stored are set with "john" as the owner.

All the files can be set with chmod 700 because only the owner needs access to their own stuff. No need to fool with group permissions.

Under this setup, it doesn't matter what user/group apache runs as. It can be nobody:nobody or apache:apache. Doesn't matter... the user/group is defined in the vhost directive.

vbfischer 07-01-2004 12:31 PM

Thanks for your response. I'll try that out.

p.s. Sorry took so long to acknowledge response...


All times are GMT -5. The time now is 05:05 AM.