Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to add subdomains to my home server.

svn.domain.com trac.domain.com

Due to dynamic IP I use dyndns service, on top of that I have domain.com hosted somewhere else. I created CNAME for subdomains on remote host to point to my user.dyndns.org domain.

So now when I visit either of subdomains: trac or svn, I see "It works!" message.

This done, I created two virtual host files under /etc/apache2/sites-enabled

file1: svn.domain.com and file2: trac.domain.com

contents:

<VirtualHost *:80>

  ServerName trac.domain.com

   DocumentRoot = /var/www/trac/repos

   <Directory /var/www/trac/repos>
    Order allow,deny
    allow from all
   </Directory>

</VirtualHost>

And

<VirtualHost *:80>

  ServerName svn.domain.com

   DocumentRoot = /var/svn/repos

   <Directory /var/svn/repos>
    Order allow,deny
    allow from all
   </Directory>

</VirtualHost>

But I get error: ERROR: Site trac.domain.com does not exist!

what am I doing wrong?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

The config files need to be under /etc/apache2/sites-available. Then, when you do a2ensite, it will symlink those files to /etc/apache2/sites-enabled. You shouldn't need to touch sites-available manually.

share|improve this answer
    
there was also '=' after documentroot :) thx. –  Sandro Dzneladze May 11 '12 at 22:42
add comment

Your Answer

 
discard

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.