# Apache fails after configuration of 2 virtual hosts

Apache does not restart after having changed the configuration.

File: /etc/apache2/sites-enabled/000-default.conf:

Listen 80
<VirtualHost *:80>
DocumentRoot /var/www/html

# Other directives here
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/html/mydomain.com
ServerName www.mydomain.com

# Other directives here
</VirtualHost>


Got this configuration from the Apache Docs.

Any idea why this does not work?

• I haven't used Apache for a long time so I can't really help with the question, but I can suggest that I find Nginx to be much faster and the configuration less confusing in situations just like this. If you are able to make the switch, I'd highly recommend looking into it. Good luck and sorry I can't be of more help. – Luke Cousins Feb 14 '15 at 15:29

If you are using Debian, you don't need to specify Listen 80 in your virtualhost, because is declared in
/etc/apache2/ports.conf:9:Listen 80