0

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?

Brigand
  • 135
  • 5
  • I spun up an Ubuntu system. If I comment out the `NameVirtualHost` line from your config file, it works just fine (this setting is already enabled in `ports.conf`). – larsks Mar 18 '13 at 20:12
  • I wasn't sure it was worth that, but sure :). – larsks Mar 18 '13 at 20:13

1 Answers1

2

I spun up an Ubuntu system. If I comment out the NameVirtualHost line from your config file, it works just fine (this setting is already enabled in ports.conf). I've been searching unsuccessfully for information on exactly why we're seeing this behavior.

larsks
  • 43,623
  • 14
  • 121
  • 180