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 would like to setup a sub domain on my server at

I am able to reach my USERDIR for each user no problem at

I am unable to setup is there something more with the DNS.

What files do I need to edit. What are the important files to be noted when trying to achieve this setup.

Please and thank you.

share|improve this question
what are you trying to achieve? do you want a subdomain for each user ( or one subdomain with the same user dirs ( – Marcel G Oct 30 '10 at 2:35
@Marcel I would like to create :) – garbagecollector Oct 30 '10 at 15:47 The files you need to edit are depending on your OS (for example in Debian -> a2ensite / in CentOS you need to edit the httpd.conf file) You must also set a DNS Record like *

share|improve this answer

this is a modified version of what you can find in the apache httpd rewrite documentation:

You'll have to put the following statements in your httpd.conf (or where ever your custom configuration options for apache are to be set, this varies from distro to distro) and make sure mod_rewrite is enabled.

RewriteEngine on
RewriteCond   %{HTTP_HOST}                  ^[^.]+\.example\.com$
RewriteRule   ^(.+)                         %{HTTP_HOST}$1      [C]
RewriteRule   ^([^.]+)\.example\.com/(.*)   /home/$1/public_html/$2

you'll also need a wildcard DNS entry (* pointing to your server IP (or a static dns entry for each and every user which gets a subdomain).

share|improve this answer

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.