I've looked at several answers here, but none of the solutions worked. Here's what I have so far in my /etc/apache2/sites-available/default
site (and it is enabled). (No modifications to other files from the apt-get install of Apache on Ubuntu 12.10.)
NameVirtualHost *:80
<VirtualHost *:80>
ServerName site.com
ServerAlias www.site.com
DocumentRoot /var/www/main/
# Directory settings, etc., removed for conciseness
</VirtualHost>
<VirtualHost *:80>
ServerName s1.site.com
DocumentRoot /var/www/subdomains/s1
</VirtualHost>
<VirtualHost *:80>
ServerName s2.site.com
DocumentRoot /var/www/subdomains/s2
</VirtualHost>
When I try to reload the server...
# apachectl -k graceful
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Mon Mar 18 19:37:00 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
Why are there no virtual hosts?