homepage Welcome to WebmasterWorld Guest from 54.227.215.140
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
NameVirtualHost <ip> has no VirtualHosts
paratwa

5+ Year Member



 
Msg#: 3554465 posted 12:58 pm on Jan 22, 2008 (gmt 0)

hi all, i'm a newbie in apache configuration and i'm experiencing some troubles. when i try to start apache i get the error message NameVirtualHost <ip> has no VirtualHosts for both the two virtualhost. here are virtualhost configuration files:
vh_vimdevr1_https.conf

NameVirtualHost 192.168.166.12:443

<VirtualHost 192.168.166.12:443>
ServerName server.name.com
ServerAlias vimdevr1
ServerAdmin admin@domain.com
DocumentRoot "/var/www/html"
ErrorLog "/var/log/httpd/ssl_error_log"
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{ctVFPortalID}i\"" combined
CustomLog "logs/ssl_access_log" combined

SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

<IfDefine LIMIP>
<Location />
MaxConnPerIP 64
</Location>
</IfDefine>
</VirtualHost>

vh_vimdevr1_http.conf

NameVirtualHost 192.168.166.12:80

<VirtualHost 192.168.166.12:80>
ServerName server.name.com
ServerAlias vimdevr1
ServerAdmin admin@domain.com
DocumentRoot "/var/www/html"
ErrorLog logs/ssl_error_log
CustomLog logs/ssl_access_log combined

<IfDefine LIMIP>
<Location />
MaxConnPerIP 64
</Location>
</IfDefine>
</VirtualHost>

this two files are included in httpd.conf, when i try to check configuration, i get the following

[root@localhost init.d]# ./httpd configtest
[Tue Jan 22 11:04:26 2008] [warn] NameVirtualHost 192.168.166.12:443 has no VirtualHosts
[Tue Jan 22 11:04:26 2008] [warn] NameVirtualHost 192.168.166.12:80 has no VirtualHosts
Syntax OK

i can't understand why i get these error messages, could someone help me please?
thank you

 

lammert

WebmasterWorld Senior Member lammert us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3554465 posted 11:42 pm on Jan 22, 2008 (gmt 0)

Paratwa,

First of all Welcome to WebmasterWorld!

The NameVirtualHost command tells Apache that you will use VirtualHost boxes on a specific IP address. This command is needed only once for each IP address. It is not necessary to repeat the NameVirtualHost directive for every VirtualHost box you use as in your example. The directive doesn't define a VirtualHost, it only tells Apache that on that IP address one or more virtual hosts will be present.

You can put the following line at the top of your config file

NameVirtualHost 192.168.166.12:80

and remove all other references. The error should go away.

NameVirtualHost is not necessary for port 443. This has nothing to do with Apache, but is because SSL connections connect with the IP address with your server and not with the virtual host name. This is a protocol issue and it is the main reason that every SSL encrypted site needs its own unique IP.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved