Bluehost.com Web Hosting $6.95

Problems with NameVirtualHost directive

This is a discussion on Problems with NameVirtualHost directive within the Linux Web Servers forums, part of the Web Server and Related Forums category; In migrating our server to a new one with Apache 2.0.52. And I'm getting various errors from ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-18-2005
news@celticbear.com
 
Posts: n/a
Default Problems with NameVirtualHost directive

In migrating our server to a new one with Apache 2.0.52.
And I'm getting various errors from my "/etc/rc.d/ini.d/httpd
configtest" depending on what I try from the O'Reilly "Apache
Definitive Guide" and similar suggestions found on the newsgroup for
similar problems.

Here's the top of my virtualdir that I have included at the end of my
httpd.conf:

NameVirtualHost (our IP)

<VirtualHost (our IP):80>
DocumentRoot /var/www/html/home/pa
ServerName (our domain).com
ServerAlias www.(our domain).com
TransferLog /var/www/html/home/logs/access_log
ErrorLog /var/www/html/home/logs/error_log
</VirtualHost>

<IfDefine HAVE_SSL>
<VirtualHost (our IP):443>
DocumentRoot /var/www/html/home/pa
ServerName (our domain).com
ServerAlias www.(our domain).com
TransferLog /var/www/html/home/pa/logs/access_log
ErrorLog /var/www/html/home/pa/logs/error_log
SSLEngine on
SSLCertificateFile /etc/httpd/conf.d/ssl.crt/(our domain).com.crt
SSLCertificateKeyFile /etc/httpd/conf.d/ssl.key/(our domain).com.key
</VirtualHost>
</IfDefine>

<VirtualHost (our IP):80>
DocumentRoot /var/www/html/home/pa2
ServerName (our domain 2).com
ServerAlias www.(our domain 2).com
</VirtualHost>

(and then about 50 more hosted domains below that one.)


Now, if I configtest just like it is above, I get 50:

[Thu Nov 17 17:23:54 2005] [error] VirtualHost (our IP):80 -- mixing *
ports and non-* ports with a NameVirtualHost address is not supported,
proceeding with undefined results

If I take out the NameVirtualHost line, I get 50:

[Thu Nov 17 16:37:15 2005] [warn] VirtualHost (our IP):80 overlaps with
VirtualHost (our IP):80, the first has precedence, perhaps you need a
NameVirtualHost directive

If I leave in the line, but change all the IP addresses to their names
like this:

<VirtualHost www.(our domain 2).com>
DocumentRoot /var/www/html/home/pa2
ServerName (our domain 2).com
ServerAlias www.(our domain 2).com
</VirtualHost>

I get 50:

[Thu Nov 17 17:33:08 2005] [error] (EAI 2)Name or service not known:
Cannot resolve host name www.(our domain 2).com --- ignoring!

followed by 50:

[Thu Nov 17 17:33:12 2005] [warn] VirtualHost www.(our domain 2).com:0
overlaps with VirtualHost www.(our domain 3).com:0, the first has
precedence, perhaps you need a NameVirtualHost directive

What combination of IP, port, names do I need to use?
I'm at the end of combinations I can think of.

Thanks for any help!
Liam

  #2 (permalink)  
Old 11-18-2005
Tim
 
Posts: n/a
Default Re: Problems with NameVirtualHost directive

On Thu, 17 Nov 2005 15:36:42 -0800, news sent:

> In migrating our server to a new one with Apache 2.0.52. And I'm getting
> various errors from my "/etc/rc.d/ini.d/httpd configtest" depending on
> what I try from the O'Reilly "Apache Definitive Guide" and similar
> suggestions found on the newsgroup for similar problems.
>
> Here's the top of my virtualdir that I have included at the end of my
> httpd.conf:
>
> NameVirtualHost (our IP)


Try changing all the "(our IP)" bits from your IP address to just: *

Condensing my config file, I have this sort of thing:

NameVirtualHost *:80

<VirtualHost _default_:80>
# Default website to serve, regardless of hostname
</VirtualHost>

<VirtualHost _default_:443>
# Default, and only, HTTPS website to serve
</VirtualHost>

<VirtualHost *:80>
# Another website
</VirtualHost>

<VirtualHost *:80>
# Yet another website
</VirtualHost>

<VirtualHost *:80>
# Yet another website
</VirtualHost>


> [Thu Nov 17 17:23:54 2005] [error] VirtualHost (our IP):80 -- mixing *
> ports and non-* ports with a NameVirtualHost address is not supported,
> proceeding with undefined results


Which is to do with the SSL site (it's not on port 80).

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

  #3 (permalink)  
Old 11-18-2005
news@celticbear.com
 
Posts: n/a
Default Re: Problems with NameVirtualHost directive


Tim wrote:
> On Thu, 17 Nov 2005 15:36:42 -0800, news sent:
>
> > In migrating our server to a new one with Apache 2.0.52. And I'm getting
> > various errors from my "/etc/rc.d/ini.d/httpd configtest" depending on
> > what I try from the O'Reilly "Apache Definitive Guide" and similar
> > suggestions found on the newsgroup for similar problems.
> >
> > Here's the top of my virtualdir that I have included at the end of my
> > httpd.conf:
> >
> > NameVirtualHost (our IP)

>
> Try changing all the "(our IP)" bits from your IP address to just: *
>
> Condensing my config file, I have this sort of thing:
>
> NameVirtualHost *:80
>
> <VirtualHost _default_:80>
> # Default website to serve, regardless of hostname
> </VirtualHost>
>
> <VirtualHost _default_:443>
> # Default, and only, HTTPS website to serve
> </VirtualHost>
>
> <VirtualHost *:80>
> # Another website
> </VirtualHost>
>
> <VirtualHost *:80>
> # Yet another website
> </VirtualHost>
>
> <VirtualHost *:80>
> # Yet another website
> </VirtualHost>
>
>
> > [Thu Nov 17 17:23:54 2005] [error] VirtualHost (our IP):80 -- mixing *
> > ports and non-* ports with a NameVirtualHost address is not supported,
> > proceeding with undefined results

>
> Which is to do with the SSL site (it's not on port 80).
>


Interesting.
Now I get 50:

[Fri Nov 18 10:27:26 2005] [warn] _default_ VirtualHost overlap on port
80, the first has precedence

But, the asterik gives me another combination component to try
different things with.
Thanks for the reply and suggestion!
-Liam

  #4 (permalink)  
Old 11-19-2005
Tim
 
Posts: n/a
Default Re: Problems with NameVirtualHost directive

Liam:

> depending on what I try from the O'Reilly "Apache Definitive Guide"


Have you tried following Apache's own documentation, instead?

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

  #5 (permalink)  
Old 11-19-2005
Tim
 
Posts: n/a
Default Re: Problems with NameVirtualHost directive

On Fri, 18 Nov 2005 08:28:42 -0800, news@celticbear.com sent:

> Interesting.
> Now I get 50:
>
> [Fri Nov 18 10:27:26 2005] [warn] _default_ VirtualHost overlap on port
> 80, the first has precedence
>
> But, the asterik gives me another combination component to try
> different things with.


Sounds like the virtual hosts conflicting with the default set in the main
configuration. I seem to recall putting <VirtualHost _default_:80> and
</VirtualHost> around the initial website configuration in the main
configuration (the /var/www/html/ part) to fix that in one incarnation of
Apache, a while ago.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:54 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0