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

What shall I do if I want to make apache to automatically create ~username subdirectories for each account? I tried to google it but I don't know how to call this...

share|improve this question
up vote 1 down vote accepted

Hey, what you're looking for is mod_userdir.

Enabling it depends on the distribution you're using.

For CentOS Open /etc/httpd/httpd.conf - search for and change:

UserDir disable


UserDir enable

Or, for Ubuntu/Debian:

a2enmod userdir

Afterwards you'll need to restart your webserver, i.e.

service httpd restart


service apache2 restart

You are also able to configure what directory is used for userdir (default public_html) by specifying UserDir [name of dir] instead of UserDir enable

share|improve this answer
I just reread your question - this doesn't CREATE the directories, just configures Apache to use them. If you want to create the physical directories you need to either manually do it or script it. You'll need to create a public_html directory in each users home. But I think my original answer is what you wanted anyway! – Rafiq Maniar Dec 2 '10 at 0:38
Thanks! It helped! – manatails008 Dec 2 '10 at 2:22

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.