Jump to content

[SOLVED] NameVirtualHost XXX has no VirtualHosts


chronister

Recommended Posts

I am trying to migrate from a windows machine running XAMPP to an actual LAMP server. UBUNTU 6.10. I got  apache installed along with php and mysql. I then proceeded to set up V-hosts because I test multiple websites on my local network as well as permanently host an intranet site for my wife (address book, calendar, recipes, etc......). I spent days trying to get them to work. I finally managed to get the names to respond and serve the proper pages in the directories, but everytime I restart apache after making a config change I get the following errors.

 

[Fri Apr 20 21:09:27 2007] [warn] NameVirtualHost jen:0 has no VirtualHosts

[Fri Apr 20 21:09:27 2007] [warn] NameVirtualHost blogw:0 has no VirtualHosts

[Fri Apr 20 21:09:27 2007] [warn] NameVirtualHost music:0 has no VirtualHosts

[Fri Apr 20 21:09:27 2007] [warn] NameVirtualHost a:0 has no VirtualHosts

[Fri Apr 20 21:09:27 2007] [warn] NameVirtualHost k:0 has no VirtualHosts

[Fri Apr 20 21:09:27 2007] [warn] NameVirtualHost nate2:0 has no VirtualHosts

<error block is repeated once more >

 

My /etc/apache2/sites-enabled/default file looks like this.

 

ServerName *

NameVirtualHost nate
    <VirtualHost nate>
    	ServerName nate
   	DocumentRoot /var/www/nate
    </VirtualHost>

NameVirtualHost jen
    <VirtualHost jen>
    	ServerName jen
      DocumentRoot /var/www/jen
    </VirtualHost>

NameVirtualHost blogw
    <VirtualHost blogw>
    	ServerName blogw
    	DocumentRoot /var/www/wordpress
    </VirtualHost>

NameVirtualHost music
    <VirtualHost music>
    	ServerName music
    	DocumentRoot /var/www/music
    </VirtualHost>

NameVirtualHost a
    <VirtualHost a>
    	ServerName a
    	DocumentRoot /var/www/phpMyAdmin
    </VirtualHost>

NameVirtualHost k
    <VirtualHost k>
    	ServerName k
    	DocumentRoot /var/www/karaoke
    </VirtualHost>

NameVirtualHost nate2
    <VirtualHost nate2>
    	ServerName nate2
    	DocumentRoot /var/www/nate_new
    </VirtualHost>

 

I am sure that there are some problems or errors here and it's probably a miracle that the machine is responding to these names, so can someone shed some light on what I am missing here??

 

thanks in advance.

 

Link to comment
Share on other sites

Guest prozente

NameVirtualHost is used to specify where you want to listen for using Name-based virtual hosting

 

so if you only had one IP address and two sites you'd have something like this:

 

Listen 10.0.0.1
NameVirtualHost 10.0.0.1

<VirtualHost 10.0.0.1>
ServerName first.example.com
DocumentRoot /var/www/first/html
</VirtualHost>

<VirtualHost 10.0.0.1>
ServerName second.example.com
DocumentRoot /var/www/second/html
</VirtualHost>

Link to comment
Share on other sites

Thank you. Although your solution did not work directly I was able to play around and find what did work.

 

I changed made the following items. I also removed the extra NameVirtualHost lines. I think that is what Apache was bitchin about anyway.

 

ServerName Linux

NameVirtualHost 192.168.0.13

 

 

Thanks for your help. I can now restart with no errors or warnings.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.