Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to configure some subdomains in apache2 (no master domain defined) and, after I write the config file for a certain domain, enable it and then try to load it, it shows me the content set by the default config file (I restarted apache). Here is a virtual host for a subdomain:

#nameVirtualHost * virtualHost *
<VirtualHost subdomain.domain.com>
ServerAdmin email@email.com
ServerName subdomain.domain.com
ServerAlias subdomain.domain.com
DocumentRoot /var/www/clients/subdomain
        <Directory /var/www/clients/subdomain>
                Options FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all

        ErrorLog /var/log/apache2/error_subdomain.com.log

        LogLevel warn

        CustomLog /var/log/apache2/access_subdomain.com.log combined
        ServerSignature Off
UseCanonicalName off

In the default config file, the path is '/var/www'.

I know that this must be supereasy, but can't catch on. Any help is highly appreciated

Thanks in advance

share|improve this question

1 Answer 1

up vote 1 down vote accepted

use, assuming you want standard HTTP on port 80 :

nameVirtualHost *:80

and then in any VirtualHost parts :

<VirtualHost *:80>
ServerName subdomain.domain.com

see http://httpd.apache.org/docs/2.2/vhosts/name-based.html

share|improve this answer
That did the trick. Thanks –  kio Jul 26 '10 at 6:46

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.