Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Problem with DynDns and Apache Virtual Hosts

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


barsiwek at interia

Oct 8, 2008, 2:43 PM

Post #1 of 13 (236 views)
Permalink
Problem with DynDns and Apache Virtual Hosts

Hello everyone

I have a weird problem that i cannot find answer for anywhere.
I have a DYNDNS domain (somedomain.selfip.org) with wildcards enabled that
points to a router/firewall/NAT running Tomato (a.somedomain.selfip.org). On
the router i have a forwarding of port 80 enabled pointing to a host on a
local network (b.somedomain.selfip.org), that is running a Apache 2.2
server. On that server i would like to host following domains:

1. somedomain.selfip.org, www.somedomain.selfip.org,
b.somedomain.selfip.org, b
pointing to /var/www/apache2-default
2. user1.somedomain.selfip.org, user2.somedomain.selfip.org
pointing to /var/www/user12

My current config is:
In /etc/apache2/httpd.conf
Code:
NameVirtualHost *:80

<IfModule mod_ssl.c>
    NameVirtualHost *:443
</IfModule>


In /etc/apache2/sites-available/default
Code:
<VirtualHost *:80>
    ServerName somedomain.selfip.org
    ServerAlias somedomain.selfip.org b.somedomain.selfip.org b
    ServerAdmin root[at]somedomain.selfip.org
    DocumentRoot /var/www/apache2-default/

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/default/error.log
    LogLevel debug

    CustomLog /var/log/apache2/default/access.log combined
    ServerSignature On
</VirtualHost>


In /etc/apache2/sites-available/user12
Code:
<VirtualHost *:80>
    ServerName user1.somedomain.selfip.org
    ServerAlias user2.somedomain.selfip.org
    ServerAdmin user12[at]mail-host.com
    DocumentRoot /var/www/user12/

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /var/www/user12/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/user12/error.log
    LogLevel debug

    CustomLog /var/log/apache2/user12/access.log combined
    ServerSignature On
</VirtualHost>

The problem is that whatever subdomain i enter:
user1.somedomain.selfip.org
user1.somedomain.selfip.org
(even a non-existent ones line - idontexist.somedomain.selfip.org) i get the
site form first virtual host.
What could be the problem.

On further investigation I found out that a server responds to requests with
a 301 (Moved Permanently) response, then the browser tries to connect to the
url pointing a page from the first domain.

Last thing (a printout from apache2 -S):
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server somedomain.selfip.org
(/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost somedomain.selfip.org
(/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost user1.somedomain.selfip.org
(/etc/apache2/sites-enabled/001-user12:1)
Syntax OK

Any ideas?

Sify




----------------------------------------------------------------------
Notowania GPW w telefonie!
Sprawdz >> http://link.interia.pl/f1f37


---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


covener at gmail

Oct 8, 2008, 3:02 PM

Post #2 of 13 (230 views)
Permalink
Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

2008/10/8 Bartłomiej Siwek <barsiwek[at]interia.pl>:

> The problem is that whatever subdomain i enter:
> user1.somedomain.selfip.org
> user1.somedomain.selfip.org
> (even a non-existent ones line - idontexist.somedomain.selfip.org) i get the
> site form first virtual host.
> What could be the problem.

That's just how it works, the first one defined in a NameVirtualHost
set is the default/catch-all.

>
> On further investigation I found out that a server responds to requests with
> a 301 (Moved Permanently) response, then the browser tries to connect to the
> url pointing a page from the first domain.

Maybe a redirect setup by your distros packaging in your default vhost.

--
Eric Covener
covener[at]gmail.com


barsiwek at interia

Oct 8, 2008, 3:13 PM

Post #3 of 13 (230 views)
Permalink
RE: Problem with DynDns and Apache Virtual Hosts [In reply to]

> 2008/10/8 Bartłomiej Siwek <barsiwek[at]interia.pl>:
>
> > The problem is that whatever subdomain i enter:
> > user1.somedomain.selfip.org
> > user1.somedomain.selfip.org
> > (even a non-existent ones line - idontexist.somedomain.selfip.org) i get
the
> > site form first virtual host.
> > What could be the problem.
>
> That's just how it works, the first one defined in a NameVirtualHost
> set is the default/catch-all.

So how would I go about setting it so the apache responds only to valid
vhosts?

> >
> > On further investigation I found out that a server responds to requests
with
> > a 301 (Moved Permanently) response, then the browser tries to connect to
the
> > url pointing a page from the first domain.
>
> Maybe a redirect setup by your distros packaging in your default vhost.

Where can I look for that? I went a few times over the config files
(apache2.conf and httpd.conf) and found nothing. Could it be someplace else?

> --
> Eric Covener
> covener[at]gmail.com


----------------------------------------------------------------------
Dzwon taniej na zagraniczne komorki!
Sprawdz >> http://link.interia.pl/f1f26


---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


krist.vanbesien at gmail

Oct 9, 2008, 1:06 AM

Post #4 of 13 (222 views)
Permalink
Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

2008/10/8 Bartłomiej Siwek <barsiwek[at]interia.pl>:

> On further investigation I found out that a server responds to requests with
> a 301 (Moved Permanently) response, then the browser tries to connect to the
> url pointing a page from the first domain.

Are you sure it is your server that does this and not selfip.org that
does it? If you tell us what the real name of your site is I can check
this.

Krist


--
krist.vanbesien[at]gmail.com
krist[at]vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?


barsiwek at interia

Oct 9, 2008, 1:51 AM

Post #5 of 13 (222 views)
Permalink
Re: Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

Krist van Besien napisał(a):
> 2008/10/8 Bartłomiej Siwek >barsiwek[at]interia.pl>:
>
> > On further investigation I found out that a server responds to requests
> with
> > a 301 (Moved Permanently) response, then the browser tries to connect to
> the
> > url pointing a page from the first domain.
>
> Are you sure it is your server that does this and not selfip.org that
> does it? If you tell us what the real name of your site is I can check
> this.
>
> Krist
>
>
> --
> krist.vanbesien[at]gmail.com
> krist[at]vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What&#039;s wrong with top-posting?
> A: Top-posting.
> Q: What&#039;s the biggest scourge on plain text email discussions?
>
>
I'm sure because it was a response I found in apache logs when i turned mod_dumpio on.

Sify


----------------------------------------------------------------------
Dzwon taniej na zagraniczne komorki!
Sprawdz >> http://link.interia.pl/f1f26


---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


krist.vanbesien at gmail

Oct 9, 2008, 2:37 AM

Post #6 of 13 (222 views)
Permalink
Re: Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

2008/10/9 Bartek ¦iwy Siwek <barsiwek[at]interia.pl>:

>> Are you sure it is your server that does this and not selfip.org that
>> does it? If you tell us what the real name of your site is I can check
>> this.
> I'm sure because it was a response I found in apache logs when i turned mod_dumpio on.

Ok. What do you have on your website? Only static content, or is some
content generated dynamically?

Krist

--
krist.vanbesien[at]gmail.com
krist[at]vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?


barsiwek at interia

Oct 9, 2008, 2:47 AM

Post #7 of 13 (222 views)
Permalink
Re: Re: Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

Krist van Besien napisał(a):
> 2008/10/9 Bartek ¦iwy Siwek >barsiwek[at]interia.pl>:
>
> >> Are you sure it is your server that does this and not selfip.org that
> >> does it? If you tell us what the real name of your site is I can check
> >> this.
> > I&#039;m sure because it was a response I found in apache logs when i turned
> mod_dumpio on.
>
> Ok. What do you have on your website? Only static content, or is some
> content generated dynamically?
>
> Krist
>
> --
> krist.vanbesien[at]gmail.com
> krist[at]vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What&#039;s wrong with top-posting?
> A: Top-posting.
> Q: What&#039;s the biggest scourge on plain text email discussions?
>
>

Static content. It will be dynamic if i can set it up ;]
Another thing a user on my network noticed - the current configuration causes that whatever non-existing url you enter (http://icannotexists/ - for example ) you get a page from the first vhost.
This is starting to look like DNS problem - Am I right?

Sify

----------------------------------------------------------------------
Dzwon taniej na zagraniczne komorki!
Sprawdz >> http://link.interia.pl/f1f26


---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


covener at gmail

Oct 9, 2008, 4:33 AM

Post #8 of 13 (215 views)
Permalink
Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

2008/10/8 Bartłomiej Siwek <barsiwek[at]interia.pl>:
>>
>> That's just how it works, the first one defined in a NameVirtualHost
>> set is the default/catch-all.
>
> So how would I go about setting it so the apache responds only to valid
> vhosts?

It has to respond if the client ends up at an IP address the server is
listening on. If you don't want to show your real content, make your
default vhost serve a dummy page or return an error.

--
Eric Covener
covener[at]gmail.com


barsiwek at interia

Oct 9, 2008, 5:13 AM

Post #9 of 13 (215 views)
Permalink
Re: Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

Eric Covener napisał(a):
> 2008/10/8 Bartłomiej Siwek >barsiwek[at]interia.pl>:
> >>
> >> That&#039;s just how it works, the first one defined in a NameVirtualHost
> >> set is the default/catch-all.
> >
> > So how would I go about setting it so the apache responds only to valid
> > vhosts?
>
> It has to respond if the client ends up at an IP address the server is
> listening on. If you don&#039;t want to show your real content, make your
> default vhost serve a dummy page or return an error.
>
> --
> Eric Covener
> covener[at]gmail.com
>
>

I'll do that. Hoever I still don't understand why the request to a second vhost end up redirected to first.

Sify

----------------------------------------------------------------------
Notowania GPW w telefonie!
Sprawdz >> http://link.interia.pl/f1f37


---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


aw at ice-sa

Oct 9, 2008, 6:03 AM

Post #10 of 13 (215 views)
Permalink
Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

Bartek ¦iwy Siwek wrote:
[...]

>
> I'll do that. Hoever I still don't understand why the request to a second vhost end up redirected to first.
>
Hi.
I think that you are getting confused between different steps of what
happens (and it is quite easy to get confused, because there are many
steps). So you need to really look at each level individually,
step-by-step, and try to figure out where the problem really is.
The point is, at this moment it is not sure that it is an Apache
problem, or a DNS problem, or a router problem, or anything else.
You can start from one end, or from the other, but you have to be
systematic about it, otherwise you will never solve it.

I'll try to help, starting from the last level, Apache and VirtualHosts.

1) a HTTP request comes into your server, if the client sent it *to the
IP address* of your Apache host.
Not to the *name* of the server or any virtual host, to the IP address.
You should only continue if you really understand this fully.

2) when the HTTP request comes into the server, it looks like this :

GET / HTTP/1.1
Host: thename.of.your.virtualhost.com

There are 2 lines :
line 1 is the HTTP request
line 2 is an additional parameter for the request
So, the name of the server to which the client wants to talk, is an
additional parameter "Host:" in the request, but it is not that name
that made it so that the request arrived at this host.
I'll explain that later.

3) Now Apache has the request.
It looks at the Host: parameter, and sees that it says
"thename.of.your.virtualhost.com".
Apache then looks at each of its VirtualHost sections, to see if one of
them matches that name.
If it finds one, then it "takes the personality" of that VirtualHost,
and answers the request.
If it does not find any VirtualHost that matches the name, then it takes
the personality of the first VirtualHost that it finds in the Apache
configuration file, and answers the request as that one.
That is why this first VirtualHost is known as "the default Virtual
Host". It is just because, if Apache cannot find the "correct" Virtual
Host, it will use this first one.

I will repeat this, so that there is no doubt :
No matter where the connection comes from, and no matter what the
request says in line 2,

Now, how does the client know, that when it wants to get the content of
the URL "http://thename.of.your.virtualhost.com", it needs to connect
via TCP/IP to the host with address 111.222.111.222, on port 80 ?

That's a matter of name resolution, or DNS.
The client (in this case the browser), will ask its underlying operating
system to translate "thename.of.your.virtualhost.com" into an IP
address. And whatever the OS answers, the client will believe it.

4) So the client asks, and gets the IP address "111.222.111.222".
Now it connects to the server at 111.222.111.222, port 80, and sends the
request :
GET / HTTP/1.1
Host: thename.of.your.virtualhost.com
and Apache responds like in 3 above.


The points to really get here :
a) if Apache gets a connection, and on that connection it gets a request
that looks like
GET / HTTP/1.1
Host: thename.of.your.virtualhost.com
then it will always handle this request, as described above.
Apache has no idea how the client got his IP address, before sending
this request. It may be that the client DNS was wrong, and gave it a
wrong IP address for "thename.of.your.virtualhost.com", but Apache knows
nothing of that.

b) if anything in-between the client and the server is intercepting that
connection, and for some reason directing it somewhere else than it
should, it will end up on another host, which maybe does not know the
VirtualHost named "thename.of.your.virtualhost.com", and will thus
respond with its default VirtualHost.

c) If your client is getting a 301 response at some point, then it means
that something sent that response.
Apache by itself will not send back a 301 response, unless you
explicitly tell it to do that somewhere in the configuration.
So if it is not Apache, it is something else that is in-between your
client and Apache.
A proxy server ? a firewall ?

---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


barsiwek at interia

Oct 9, 2008, 2:28 PM

Post #11 of 13 (202 views)
Permalink
RE: Problem with DynDns and Apache Virtual Hosts [In reply to]

I investigated the problem further, and that:
- DNS is working correctly.
- The Apache is sending (still for reasons unknown the 301 response). Below
is the extract from error.log of the first domain (with mod_dumpio turned
on):
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 16 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): GET / HTTP/1.1\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 173 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-ms-application, application/vnd.ms-xpsdocument,
application/xaml+xml, application/x-ms-xbap, */*\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 21 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept-Language: pl\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 15 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): UA-CPU: AMD64\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 32 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept-Encoding: gzip, deflate\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 143 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;
Win64; x64; .NET CLR 2.0.50727; SLCC1; .NET CLR 3.5.21022; .NET CLR
3.0.04506)\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 32 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Host: user1.somedomain.selfip.org\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 24 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Connection: Keep-Alive\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 2 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): \r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(data-HEAP): 431 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out
(data-HEAP): HTTP/1.1 301 Moved Permanently\r\nDate: Thu, 09 Oct 2008
21:18:32 GMT\r\nServer: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4
PHP/5.2.0-8+etch11 mod_perl/2.0.2 Perl/v5.8.8\r\nX-Powered-By:
PHP/5.2.0-8+etch11\r\nX-Pingback:
http://www.somedomain.selfip.org/~sify/xmlrpc.php\r\nLocation:
http://www.somedomain.selfip.org/\r\nContent-Length: 0\r\nKeep-Alive:
timeout=15, max=100\r\nConnection: Keep-Alive\r\nContent-Type: text/html;
charset=UTF-8\r\n\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-EOS): 0 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[eatcrlf-nonblocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(117): mod_dumpio: dumpio_in
- 11
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 16 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): GET / HTTP/1.1\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 173 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-ms-application, application/vnd.ms-xpsdocument,
application/xaml+xml, application/x-ms-xbap, */*\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 21 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept-Language: pl\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 15 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): UA-CPU: AMD64\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 32 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept-Encoding: gzip, deflate\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 143 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;
Win64; x64; .NET CLR 2.0.50727; SLCC1; .NET CLR 3.5.21022; .NET CLR
3.0.04506)\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 24 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Connection: Keep-Alive\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 30 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Host: www.somedomain.selfip.org\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 2 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): \r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(data-HEAP): 378 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out
(data-HEAP): HTTP/1.1 200 OK\r\nDate: Thu, 09 Oct 2008 21:18:32
GMT\r\nServer: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4
PHP/5.2.0-8+etch11 mod_perl/2.0.2 Perl/v5.8.8\r\nLast-Modified: Sat, 04 Oct
2008 23:59:55 GMT\r\nETag: "104826-f7-3f1b94c0"\r\nAccept-Ranges:
bytes\r\nContent-Length: 247\r\nKeep-Alive: timeout=15,
max=100\r\nConnection: Keep-Alive\r\nContent-Type: text/html;
charset=UTF-8\r\n\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(data-FILE): 247 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out
(data-MMAP): <html>\n<head>\n<title>..:: The Somedomain Group
::..</title>\n<style>\nbody {\n margin: 0;\n padding: 1em 2em;\n
text-align: center;\n}\n</style>\n</head>\n<body>\n<img id="SomedomainLogo"
src="Somedomain-Logo.jpg" alt="The Somedomain Group" />\n</body>\n</html>\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-EOS): 0 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[eatcrlf-nonblocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(117): mod_dumpio: dumpio_in
- 11
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 32 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): GET /Somedomain-Logo.jpg HTTP/1.1\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 13 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept: */*\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 41 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Referer: http://www.somedomain.selfip.org/\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 21 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept-Language: pl\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 15 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): UA-CPU: AMD64\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 32 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept-Encoding: gzip, deflate\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 143 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;
Win64; x64; .NET CLR 2.0.50727; SLCC1; .NET CLR 3.5.21022; .NET CLR
3.0.04506)\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 30 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Host: www.somedomain.selfip.org\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 24 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Connection: Keep-Alive\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 2 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): \r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(data-HEAP): 367 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out
(data-HEAP): HTTP/1.1 200 OK\r\nDate: Thu, 09 Oct 2008 21:18:32
GMT\r\nServer: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4
PHP/5.2.0-8+etch11 mod_perl/2.0.2 Perl/v5.8.8\r\nLast-Modified: Sat, 04 Oct
2008 17:41:01 GMT\r\nETag: "10482a-e71b-f40e4540"\r\nAccept-Ranges:
bytes\r\nContent-Length: 59163\r\nKeep-Alive: timeout=15,
max=99\r\nConnection: Keep-Alive\r\nContent-Type: image/jpeg\r\n\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(data-FILE): 59163 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out
(data-MMAP): \xff\xd8\xff\xe0
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-EOS): 0 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[eatcrlf-nonblocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(117): mod_dumpio: dumpio_in
- 11
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 27 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): GET /favicon.ico HTTP/1.1\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 13 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept: */*\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 15 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): UA-CPU: AMD64\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 32 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Accept-Encoding: gzip, deflate\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 143 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;
Win64; x64; .NET CLR 2.0.50727; SLCC1; .NET CLR 3.5.21022; .NET CLR
3.0.04506)\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 30 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Host: www.somedomain.selfip.org\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 24 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): Connection: Keep-Alive\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in
(data-HEAP): 2 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in
(data-HEAP): \r\n
[Thu Oct 09 23:18:32 2008] [error] [client 192.168.2.1] File does not exist:
/var/www/apache2-default/favicon.ico
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(data-HEAP): 293 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out
(data-HEAP): HTTP/1.1 404 Not Found\r\nDate: Thu, 09 Oct 2008 21:18:32
GMT\r\nServer: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4
PHP/5.2.0-8+etch11 mod_perl/2.0.2 Perl/v5.8.8\r\nContent-Length:
373\r\nKeep-Alive: timeout=15, max=98\r\nConnection:
Keep-Alive\r\nContent-Type: text/html; charset=iso-8859-1\r\n\r\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(data-HEAP): 373 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out
(data-HEAP): <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
2.0//EN">\n<html><head>\n<title>404 Not
Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL
/favicon.ico was not found on this server.</p>\n<hr>\n<address>Apache/2.2.3
(Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch11 mod_perl/2.0.2
Perl/v5.8.8 Server at www.somedomain.selfip.org Port
80</address>\n</body></html>\n
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-EOS): 0 bytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[eatcrlf-nonblocking] 0 readbytes
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(117): mod_dumpio: dumpio_in
- 11
[Thu Oct 09 23:18:32 2008] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in
[getline-blocking] 0 readbytes
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(117): mod_dumpio: dumpio_in
- 70007
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-FLUSH): 0 bytes
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-EOC): 0 bytes
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(117): mod_dumpio: dumpio_in
- 70007
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-FLUSH): 0 bytes
[Thu Oct 09 23:18:47 2008] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out
(metadata-EOC): 0 bytes

So clearly apache gets the request as described and acts... quite strange.
Any more ideas?
Because I'm all out of mine.

Sify

P.S. I don't know if I mentioned this but the box runs Debian 4.0

-----Original Message-----
From: André Warnier [mailto:aw[at]ice-sa.com]
Sent: Thursday, October 09, 2008 3:03 PM
To: users[at]httpd.apache.org
Subject: Re: [users[at]httpd] Problem with DynDns and Apache Virtual Hosts

Bartek ¦iwy User1 wrote:
[...]

>
> I'll do that. Hoever I still don't understand why the request to a second
vhost end up redirected to first.
>
Hi.
I think that you are getting confused between different steps of what
happens (and it is quite easy to get confused, because there are many
steps). So you need to really look at each level individually,
step-by-step, and try to figure out where the problem really is.
The point is, at this moment it is not sure that it is an Apache
problem, or a DNS problem, or a router problem, or anything else.
You can start from one end, or from the other, but you have to be
systematic about it, otherwise you will never solve it.

I'll try to help, starting from the last level, Apache and VirtualHosts.

1) a HTTP request comes into your server, if the client sent it *to the
IP address* of your Apache host.
Not to the *name* of the server or any virtual host, to the IP address.
You should only continue if you really understand this fully.

2) when the HTTP request comes into the server, it looks like this :

GET / HTTP/1.1
Host: thename.of.your.virtualhost.com

There are 2 lines :
line 1 is the HTTP request
line 2 is an additional parameter for the request
So, the name of the server to which the client wants to talk, is an
additional parameter "Host:" in the request, but it is not that name
that made it so that the request arrived at this host.
I'll explain that later.

3) Now Apache has the request.
It looks at the Host: parameter, and sees that it says
"thename.of.your.virtualhost.com".
Apache then looks at each of its VirtualHost sections, to see if one of
them matches that name.
If it finds one, then it "takes the personality" of that VirtualHost,
and answers the request.
If it does not find any VirtualHost that matches the name, then it takes
the personality of the first VirtualHost that it finds in the Apache
configuration file, and answers the request as that one.
That is why this first VirtualHost is known as "the default Virtual
Host". It is just because, if Apache cannot find the "correct" Virtual
Host, it will use this first one.

I will repeat this, so that there is no doubt :
No matter where the connection comes from, and no matter what the
request says in line 2,

Now, how does the client know, that when it wants to get the content of
the URL "http://thename.of.your.virtualhost.com", it needs to connect
via TCP/IP to the host with address 111.222.111.222, on port 80 ?

That's a matter of name resolution, or DNS.
The client (in this case the browser), will ask its underlying operating
system to translate "thename.of.your.virtualhost.com" into an IP
address. And whatever the OS answers, the client will believe it.

4) So the client asks, and gets the IP address "111.222.111.222".
Now it connects to the server at 111.222.111.222, port 80, and sends the
request :
GET / HTTP/1.1
Host: thename.of.your.virtualhost.com
and Apache responds like in 3 above.


The points to really get here :
a) if Apache gets a connection, and on that connection it gets a request
that looks like
GET / HTTP/1.1
Host: thename.of.your.virtualhost.com
then it will always handle this request, as described above.
Apache has no idea how the client got his IP address, before sending
this request. It may be that the client DNS was wrong, and gave it a
wrong IP address for "thename.of.your.virtualhost.com", but Apache knows
nothing of that.

b) if anything in-between the client and the server is intercepting that
connection, and for some reason directing it somewhere else than it
should, it will end up on another host, which maybe does not know the
VirtualHost named "thename.of.your.virtualhost.com", and will thus
respond with its default VirtualHost.

c) If your client is getting a 301 response at some point, then it means
that something sent that response.
Apache by itself will not send back a 301 response, unless you
explicitly tell it to do that somewhere in the configuration.
So if it is not Apache, it is something else that is in-between your
client and Apache.
A proxy server ? a firewall ?

---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org



----------------------------------------------------------------------
Dzwon taniej na zagraniczne komorki!
Sprawdz >> http://link.interia.pl/f1f26


---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


covener at gmail

Oct 9, 2008, 3:58 PM

Post #12 of 13 (202 views)
Permalink
Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

On Thu, Oct 9, 2008 at 5:28 PM, Bartłomiej Siwek <barsiwek[at]interia.pl> wrote:
> P.S. I don't know if I mentioned this but the box runs Debian 4.0
>

Debian has a redirect in the "default" vhost. Check your configuration.
--
Eric Covener
covener[at]gmail.com


uhlar at fantomas

Oct 10, 2008, 3:28 AM

Post #13 of 13 (186 views)
Permalink
Re: Problem with DynDns and Apache Virtual Hosts [In reply to]

> > 2008/10/8 Bartłomiej Siwek <barsiwek[at]interia.pl>:
> >
> > > The problem is that whatever subdomain i enter:
> > > user1.somedomain.selfip.org
> > > user1.somedomain.selfip.org
> > > (even a non-existent ones line - idontexist.somedomain.selfip.org) i get
> the
> > > site form first virtual host.
> > > What could be the problem.
> >
> > That's just how it works, the first one defined in a NameVirtualHost
> > set is the default/catch-all.

On 09.10.08 00:13, Bartłomiej Siwek wrote:
> So how would I go about setting it so the apache responds only to valid
> vhosts?

define dummy virtual host as the first one, probably sending an error for
everything.

The problem may be that not only names in ServerName and ServerAlias are
defined to match the vhost, but also the name in <VirtualHost>. Since you
use <VirtualHost *>, it shoult not matter (nobody will probably ask for
"Host: *").

--
Matus UHLAR - fantomas, uhlar[at]fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Spam is for losers who can't get business any other way.

---------------------------------------------------------------------
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[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.