I use Debian 7 and have installed a virtual host with address sub.domain.com following this tutorial: http://www.debian-administration.org/articles/412

I have enabled it, rebooted the PC but still the subdomain opens /var/www

Here is the file contents of the file named "sub.domain.com", located at /etc/apache2/sites-available/ :

<VirtualHost *>
    ServerName sub.domain.com
    DocumentRoot /usr/share/destfolder
    ServerAdmin [email protected]
    ErrorLog /var/log/apache2/sub.domain.com-error_log
    CustomLog /var/log/apache2/sub.domain.com-access_log common

By the way when I reload apache's configuration, I get: NameVirtualHost *:80 has no VirtualHosts

Any suggestions?

  • 1
    it should be <VirtualHost *:80> not <VirtualHost *> Sep 23, 2013 at 12:36
  • @Rahul Patil Can you post your comment as an answer?
    – krowe
    Sep 23, 2013 at 14:20

1 Answer 1


In your Configuration , it should be <VirtualHost *:80> not <VirtualHost *>

To test the Apache configuration file for errors, use the following command:

apachectl configtest

If the configuration file is fine, this command will return Syntax Ok. Otherwise, it will return detailed information about the error discovered.

If you are using Redhat based OS then you can use :

httpd -t

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .