Welcome to WebmasterWorld Guest from 54.145.166.96

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

NameVirtualHost <ip> has no VirtualHosts

   
12:58 pm on Jan 22, 2008 (gmt 0)

5+ Year Member



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

11:42 pm on Jan 22, 2008 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month