File Permissions for Small Shared Hosting Setup

Support for webhosts that use CentOS
Post Reply
tchubb
Posts: 11
Joined: 2007/11/02 19:29:52

File Permissions for Small Shared Hosting Setup

Post by tchubb » 2011/04/20 12:07:44

Hi Guy and Girls,
I hope I am not repeating questions asked in the past. I have a VPS (HVM) that I run Centos 5.6. I run a few different services, one being HTTPD. Basically I have a few websites hosted on the server, each has their own user and a home directory for the webroot. For example

www.domain1.co.uk > /home/domain1.co.uk/www
www.domain2.co.uk > /home/domain2.co.uk/www


I have set the following permissions.

www.domain1.co.uk > /home/domain1.co.uk/www

User : rwx
Group : rx
Other :
Ownership
User : domain1.co.uk
group : apache


www.domain1.co.uk > /home/domain2.co.uk/www
User : rwx
Group : rx
Other :
Ownership
User : domain2.co.uk
group : apache

How can I make files uploaded via ftp have these default permissions? I don’t want each user in the apache group as this would give access to each others website. How would this be done in normal shared hosting? So I need to use umask, but how would I set the default group if the user is not in it.

Hope my post is clear in what I am asking.

hansolo
Posts: 231
Joined: 2010/01/13 11:17:42
Location: SI

Re: File Permissions for Small Shared Hosting Setup

Post by hansolo » 2011/04/28 16:12:02

AFAIK
vsFTPd has a setting in [b]/etc/vsftpd/vsftpd.conf[/b]
-- change yours to
local_umask=022 (which is reverse 755)

and the owner will have all permissions, while others 'rx'

User's group is defined when creating user or later by changing the group of the user:
some nice [url=http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/]examples[/url] here

Post Reply

Return to “CentOS 5 - Webhosting Support”