Server Fault is a question and answer site for system and network administrators. 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

I have a fresh installation of Ubuntu 10.10 Server w/ LAMP. I've created a new user account and added a public_html folder in their home directory. I installed and used Webmin to create a new VirtualHost and modified that host's DocumentRoot to /userfolder/public_html. In addition, I've properly symlinked the config file for that Vhost from sites-available to sites-enabled.

As of right now, I'm the only user on the server. If I want to add others (new user account, separate public_html directory), do I just repeat the process above? Or, are their security considerations? What permissions do these directories need (chown useraccount, chgrp www-data, chmod 755)? Can I apply umask 022 automatically to all new files/folders?

Thanks in advance for any help.

share|improve this question
up vote 0 down vote accepted

You have several questions so I will address them in a list.

  • Yes, repeating the process will work for additional users.
  • For every directory in the structure above the public_html directory, the last bit in the mode must be set (--------x) (as well as any other bits) i.e., if /home/joe/public_html is the dir., home must have atleast --------x and joe must have atleast --------x

  • /blah/foo/bar/public_html (and any subdirectories) must have atleast ------r-x

  • Files that should be web-accessible must be atleast ------r--
  • umask 022 will create directories rwxr-xr-x and files rw-r--r-- so this is fine

Some considerations:

  • If you are changing the group to www-data, you can use group permissions instead of other/world permissions above.
  • You don't need a vhost for every public_html, this just makes the URLs cleaner. If you don't create the vhost, the default way to access each user's site is (This might still work even with vhosts. I've never actually used vhosts with users' public_html.
share|improve this answer
Thanks, great tips. – Trent Scott May 12 '11 at 17:44

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.