You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tobias <Co...@gmx.net> on 2003/01/10 23:30:44 UTC

[users@httpd] Apache-2.0.43 and VirtualHost problem.

hi apache-users :)

i've a little problem with virtualhosts under 2.0.43:

the browser goes every time to www.example1.org.
as doku this behaviour is an evidence to wrong configuration...

(http://httpd.apache.org/docs-2.0/vhosts/name-based.html
"If no matching virtual host is found, then the first listed
virtual host that matches the IP address will be used.")

my config:

#tail -20 httpd.conf
   
   Listen 80
   NameVirtualHost *
   ServerName www.example.org
   DocumentRoot /usr/local/apache/htdocs/
   <VirtualHost *>
   DocumentRoot /usr/local/apache/htdocs/vh1
   ServerName www.example1.com
   # Other directives here
   </VirtualHost>
   <VirtualHost *>
   DocumentRoot /usr/local/apache/htdocs/vh1
   ServerName www.example2.org
   # Other directives here
   </VirtualHost>

(this was from http://httpd.apache.org/docs-2.0/vhosts/examples.html)

name_checks:

#grep vh  /etc/hosts
10.0.0.11       www.example.com         vh
10.0.0.11       www.example1.com        vh1
10.0.0.11       www.example2.com        vh2
#ping -c1 vh
PING www.example.com (10.0.0.11): 56 data bytes
64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms

--- www.example.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.1/0.1/0.1 ms
#ping -c1 vh1
PING www.example1.com (10.0.0.11): 56 data bytes
64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms

--- www.example1.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.1/0.1/0.1 ms
#ping -c1 vh2
PING www.example2.com (10.0.0.11): 56 data bytes
64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms

--- www.example2.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.1/0.1/0.1 ms


have you any idea whats wrong?

thx
toby

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache-2.0.43 and VirtualHost problem.

Posted by Stolen <st...@thecave.net>.
You haven't specified a virtual host for www.example.com
You have specified the same document root for both www.example1.com and 
www.example2.com


Tobias wrote:

>hi folks,
>
>is my problem so strange? has really nobody here a guess?
>
>cu
>Toby
>
>Tobias <Co...@gmx.net> wrote:
>  
>
>>hi apache-users :)
>>
>>i've a little problem with virtualhosts under 2.0.43:
>>
>>the browser goes every time to www.example1.org.
>>as doku this behaviour is an evidence to wrong configuration...
>>
>>(http://httpd.apache.org/docs-2.0/vhosts/name-based.html
>>"If no matching virtual host is found, then the first listed
>>virtual host that matches the IP address will be used.")
>>
>>my config:
>>
>>#tail -20 httpd.conf
>>   
>>   Listen 80
>>   NameVirtualHost *
>>   ServerName www.example.org
>>   DocumentRoot /usr/local/apache/htdocs/
>>   <VirtualHost *>
>>   DocumentRoot /usr/local/apache/htdocs/vh1  
>>   ServerName www.example1.com
>>   # Other directives here
>>   </VirtualHost>
>>   <VirtualHost *>
>>   DocumentRoot /usr/local/apache/htdocs/vh1
>>   ServerName www.example2.org
>>   # Other directives here
>>   </VirtualHost>
>>
>>(this was from http://httpd.apache.org/docs-2.0/vhosts/examples.html)
>>
>>name_checks:
>>
>>#grep vh  /etc/hosts
>>10.0.0.11       www.example.com         vh
>>10.0.0.11       www.example1.com        vh1
>>10.0.0.11       www.example2.com        vh2
>>#ping -c1 vh
>>PING www.example.com (10.0.0.11): 56 data bytes
>>64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
>>
>>--- www.example.com ping statistics ---
>>1 packets transmitted, 1 packets received, 0% packet loss
>>round-trip min/avg/max = 0.1/0.1/0.1 ms
>>#ping -c1 vh1
>>PING www.example1.com (10.0.0.11): 56 data bytes
>>64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
>>
>>--- www.example1.com ping statistics ---
>>1 packets transmitted, 1 packets received, 0% packet loss
>>round-trip min/avg/max = 0.1/0.1/0.1 ms
>>#ping -c1 vh2
>>PING www.example2.com (10.0.0.11): 56 data bytes
>>64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
>>
>>--- www.example2.com ping statistics ---
>>1 packets transmitted, 1 packets received, 0% packet loss
>>round-trip min/avg/max = 0.1/0.1/0.1 ms
>>
>>
>>have you any idea whats wrong?
>>
>>thx
>>toby
>>    
>>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>  
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache-2.0.43 and VirtualHost problem.

Posted by Simona D'Ambrosio <si...@adria-web.com>.
I am not very expert, but it seems to be the same problem I had last week.
A guy in the list told me to see if I had the "NameVirtualHost yourIP"
specified in the httpd.conf.
I had none, so I added that directive and everything went fine.
Bye
Simona

----- Original Message -----
From: "Tobias" <Co...@gmx.net>
To: <us...@httpd.apache.org>
Sent: Sunday, January 12, 2003 8:34 PM
Subject: Re: [users@httpd] Apache-2.0.43 and VirtualHost problem.


> hi folks,
>
> is my problem so strange? has really nobody here a guess?
>
> cu
> Toby
>
> Tobias <Co...@gmx.net> wrote:
> > hi apache-users :)
> >
> > i've a little problem with virtualhosts under 2.0.43:
> >
> > the browser goes every time to www.example1.org.
> > as doku this behaviour is an evidence to wrong configuration...
> >
> > (http://httpd.apache.org/docs-2.0/vhosts/name-based.html
> > "If no matching virtual host is found, then the first listed
> > virtual host that matches the IP address will be used.")
> >
> > my config:
> >
> > #tail -20 httpd.conf
> >
> >    Listen 80
> >    NameVirtualHost *
> >    ServerName www.example.org
> >    DocumentRoot /usr/local/apache/htdocs/
> >    <VirtualHost *>
> >    DocumentRoot /usr/local/apache/htdocs/vh1
> >    ServerName www.example1.com
> >    # Other directives here
> >    </VirtualHost>
> >    <VirtualHost *>
> >    DocumentRoot /usr/local/apache/htdocs/vh1
> >    ServerName www.example2.org
> >    # Other directives here
> >    </VirtualHost>
> >
> > (this was from http://httpd.apache.org/docs-2.0/vhosts/examples.html)
> >
> > name_checks:
> >
> > #grep vh  /etc/hosts
> > 10.0.0.11       www.example.com         vh
> > 10.0.0.11       www.example1.com        vh1
> > 10.0.0.11       www.example2.com        vh2
> > #ping -c1 vh
> > PING www.example.com (10.0.0.11): 56 data bytes
> > 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> >
> > --- www.example.com ping statistics ---
> > 1 packets transmitted, 1 packets received, 0% packet loss
> > round-trip min/avg/max = 0.1/0.1/0.1 ms
> > #ping -c1 vh1
> > PING www.example1.com (10.0.0.11): 56 data bytes
> > 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> >
> > --- www.example1.com ping statistics ---
> > 1 packets transmitted, 1 packets received, 0% packet loss
> > round-trip min/avg/max = 0.1/0.1/0.1 ms
> > #ping -c1 vh2
> > PING www.example2.com (10.0.0.11): 56 data bytes
> > 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> >
> > --- www.example2.com ping statistics ---
> > 1 packets transmitted, 1 packets received, 0% packet loss
> > round-trip min/avg/max = 0.1/0.1/0.1 ms
> >
> >
> > have you any idea whats wrong?
> >
> > thx
> > toby
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache-2.0.43 and VirtualHost problem.

Posted by Jurgen <ap...@squarehosting.com>.
Hi,

beside stolen's answers:
in your data provided below you mix .org and .com randomly.

1. Which browser are you using? Does it send the host name header?
2. Are you really accessing www.example2.org or just example2.org?

Jurgen


On Sun, 12 Jan 2003 20:34:05 +0100
Tobias <Co...@gmx.net> wrote:

> hi folks,
> 
> is my problem so strange? has really nobody here a guess?
> 
> cu
> Toby
> 
> Tobias <Co...@gmx.net> wrote:
> > hi apache-users :)
> > 
> > i've a little problem with virtualhosts under 2.0.43:
> > 
> > the browser goes every time to www.example1.org.
> > as doku this behaviour is an evidence to wrong configuration...
> > 
> > (http://httpd.apache.org/docs-2.0/vhosts/name-based.html
> > "If no matching virtual host is found, then the first listed
> > virtual host that matches the IP address will be used.")
> > 
> > my config:
> > 
> > #tail -20 httpd.conf
> >    
> >    Listen 80
> >    NameVirtualHost *
> >    ServerName www.example.org
> >    DocumentRoot /usr/local/apache/htdocs/
> >    <VirtualHost *>
> >    DocumentRoot /usr/local/apache/htdocs/vh1
> >    ServerName www.example1.com
> >    # Other directives here
> >    </VirtualHost>
> >    <VirtualHost *>
> >    DocumentRoot /usr/local/apache/htdocs/vh1
> >    ServerName www.example2.org
> >    # Other directives here
> >    </VirtualHost>
> > 
> > (this was from http://httpd.apache.org/docs-2.0/vhosts/examples.html)
> > 
> > name_checks:
> > 
> > #grep vh  /etc/hosts
> > 10.0.0.11       www.example.com         vh
> > 10.0.0.11       www.example1.com        vh1
> > 10.0.0.11       www.example2.com        vh2
> > #ping -c1 vh
> > PING www.example.com (10.0.0.11): 56 data bytes
> > 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> > 
> > --- www.example.com ping statistics ---
> > 1 packets transmitted, 1 packets received, 0% packet loss
> > round-trip min/avg/max = 0.1/0.1/0.1 ms
> > #ping -c1 vh1
> > PING www.example1.com (10.0.0.11): 56 data bytes
> > 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> > 
> > --- www.example1.com ping statistics ---
> > 1 packets transmitted, 1 packets received, 0% packet loss
> > round-trip min/avg/max = 0.1/0.1/0.1 ms
> > #ping -c1 vh2
> > PING www.example2.com (10.0.0.11): 56 data bytes
> > 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> > 
> > --- www.example2.com ping statistics ---
> > 1 packets transmitted, 1 packets received, 0% packet loss
> > round-trip min/avg/max = 0.1/0.1/0.1 ms
> > 
> > 
> > have you any idea whats wrong?
> > 
> > thx
> > toby
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache-2.0.43 and VirtualHost problem.

Posted by Tobias <Co...@gmx.net>.
hi folks,

is my problem so strange? has really nobody here a guess?

cu
Toby

Tobias <Co...@gmx.net> wrote:
> hi apache-users :)
> 
> i've a little problem with virtualhosts under 2.0.43:
> 
> the browser goes every time to www.example1.org.
> as doku this behaviour is an evidence to wrong configuration...
> 
> (http://httpd.apache.org/docs-2.0/vhosts/name-based.html
> "If no matching virtual host is found, then the first listed
> virtual host that matches the IP address will be used.")
> 
> my config:
> 
> #tail -20 httpd.conf
>    
>    Listen 80
>    NameVirtualHost *
>    ServerName www.example.org
>    DocumentRoot /usr/local/apache/htdocs/
>    <VirtualHost *>
>    DocumentRoot /usr/local/apache/htdocs/vh1
>    ServerName www.example1.com
>    # Other directives here
>    </VirtualHost>
>    <VirtualHost *>
>    DocumentRoot /usr/local/apache/htdocs/vh1
>    ServerName www.example2.org
>    # Other directives here
>    </VirtualHost>
> 
> (this was from http://httpd.apache.org/docs-2.0/vhosts/examples.html)
> 
> name_checks:
> 
> #grep vh  /etc/hosts
> 10.0.0.11       www.example.com         vh
> 10.0.0.11       www.example1.com        vh1
> 10.0.0.11       www.example2.com        vh2
> #ping -c1 vh
> PING www.example.com (10.0.0.11): 56 data bytes
> 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> 
> --- www.example.com ping statistics ---
> 1 packets transmitted, 1 packets received, 0% packet loss
> round-trip min/avg/max = 0.1/0.1/0.1 ms
> #ping -c1 vh1
> PING www.example1.com (10.0.0.11): 56 data bytes
> 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> 
> --- www.example1.com ping statistics ---
> 1 packets transmitted, 1 packets received, 0% packet loss
> round-trip min/avg/max = 0.1/0.1/0.1 ms
> #ping -c1 vh2
> PING www.example2.com (10.0.0.11): 56 data bytes
> 64 bytes from 10.0.0.11: icmp_seq=0 ttl=255 time=0.1 ms
> 
> --- www.example2.com ping statistics ---
> 1 packets transmitted, 1 packets received, 0% packet loss
> round-trip min/avg/max = 0.1/0.1/0.1 ms
> 
> 
> have you any idea whats wrong?
> 
> thx
> toby

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org