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

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?

share|improve this question
    
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
    
Thanks :-) Post it as an answer, please. –  FakeRainBrigand Mar 18 '13 at 20:13
    
I wasn't sure it was worth that, but sure :). –  larsks Mar 18 '13 at 20:13
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

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.