Problems with NameVirtualHost directive
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Unix and Linux > Problems with NameVirtualHost directive




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Problems with NameVirtualHost directive  
news@celticbear.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-17-05 11:10 PM

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 w
ith
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






[ Post a follow-up to this message ]



    Re: Problems with NameVirtualHost directive  
Tim


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-18-05 01:53 AM

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 -- mixi
ng *
> 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.






[ Post a follow-up to this message ]



    Re: Problems with NameVirtualHost directive  
news@celticbear.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-18-05 10:51 PM


Tim wrote:
> On Thu, 17 Nov 2005 15:36:42 -0800, news sent:
> 
>
> 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>
>
> 
>
> 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 p
ort
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






[ Post a follow-up to this message ]



    Re: Problems with NameVirtualHost directive  
Tim


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-19-05 07:47 AM

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.






[ Post a follow-up to this message ]



    Re: Problems with NameVirtualHost directive  
Tim


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-19-05 07:47 AM

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.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:51 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register