Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ubuntu 10.04 server that is currently setup only to run a single website. I would like to setup a subdomain to point to specific section of this website. For example, I want to point to What is the best way to make this happen?

share|improve this question
Can you clarify what behavior you're looking to achieve? "point to" is vague; are you looking to redirect, serve the content from the subdomain transparently, or something else? And can you provide more information about your current configuration? Ubuntu's default configuration uses virtual hosts - have you removed those? – Shane Madden Aug 29 '12 at 2:51
I want to have load the webpage at /var/www/test. Where as typically just loads /var/www. I installed apache2 and made no modifications to it. So however it is by default is how I have it set up currently. – Mitch Aug 29 '12 at 4:39

Create a new vhost:

touch /etc/apache2/sites-available/

Give it some content:

<VirtualHost *:80>
    DocumentRoot /var/www/test
    # ..any other config needed
    <Directory /var/www/test>
        Order Allow,Deny
        Allow from all

Enable it:


And restart Apache:

service apache2 restart

Make sure name resolution for the new name is pointing to your server correctly.

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.