You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gregg Donley <gr...@nvsys.com> on 2003/07/25 17:20:05 UTC

[users@httpd] Problem with multiple virtual hosts and dynamic dns

I have three domains for which I am hosting websites on my windows box. 
All three domains
use url framing to point to the same dynamic dns host.  The problem is 
that apache seems
unable to distinguish between the three domains and access the correct 
virtual host container, it
sends them all to the default virtual host.  Creating an additional 
virtual host with the name of the
dynamic dns host confirms that apache is seeing that host name rather 
than the host specified by the
client.  Is this the expected behavior?  It there a way to have multiple 
domains point to the same
dynamic dns host and still have apache distiguish between them and 
direct them to different
virtual hosts?

Thanks.

NameVirtualHost *

# Default - seems to catch everything if the dyn_dns virtual host is 
omitted
<VirtualHost *>
 ServerName default
 DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs"
 ScriptAlias /cgi-bin/ \
              "C:\Program Files\Apache Group\Apache2\cgi-bin/"
 ErrorLog     "C:\Program Files\Apache Group\Apache2\logs\error.log"
 CustomLog    "C:\Program Files\Apache Group\Apache2\logs\access.log" 
common
</VirtualHost>

# First domain
<VirtualHost *>
 ServerName domain1.com
 ServerAlias *.domain1.com
 DocumentRoot "C:\Program Files\Apache Group\Apache2\domain1.com\htdocs"
 ScriptAlias /cgi-bin/ \
              "C:\Program Files\Apache Group\Apache2\domain1.com\cgi-bin/"
 ErrorLog     "C:\Program Files\Apache 
Group\Apache2\domain1.com\logs\error.log"
 CustomLog    "C:\Program Files\Apache 
Group\Apache2\domain1.com\logs\access.log" common
</VirtualHost>

# Second domain
<VirtualHost *>
 ServerName domain2.com
 ServerAlias *.domain2.com
 DocumentRoot "C:\Program Files\Apache Group\Apache2\domain2.com\htdocs"
 ScriptAlias /cgi-bin/ \
              "C:\Program Files\Apache Group\Apache2\domain2.com\cgi-bin/"
 ErrorLog     "C:\Program Files\Apache 
Group\Apache2\domain2.com\logs\error.log"
 CustomLog    "C:\Program Files\Apache 
Group\Apache2\domain2.com\logs\access.log" common
</VirtualHost>

# Added virtual host for dynamic dns host which, if present, gets all 
request.
<VirtualHost *>
 ServerName dyn_dns.com
 ServerAlias *.dyn_dns.com
 DocumentRoot "C:\Program Files\Apache Group\Apache2\dyn_dns.com\htdocs"
 ScriptAlias /cgi-bin/ \
              "C:\Program Files\Apache Group\Apache2\dyn_dns.com\cgi-bin/"
 ErrorLog     "C:\Program Files\Apache 
Group\Apache2\dyn_dns.com\logs\error.log"
 CustomLog    "C:\Program Files\Apache 
Group\Apache2\dyn_dns.com\logs\access.log" common
</VirtualHost>



---------------------------------------------------------------------
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] Problem with multiple virtual hosts and dynamic dns

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 25 Jul 2003, Gregg Donley wrote:

> Thanks Joshua and Jeff for the responses. My domains are registered
> though registerfly and they provide
> what they call "URL Framing" but I am not sure about the specifics of
> how that works. The dynamic dns
> I am currently using is though tzo.com, but I have considered trying
> some others so see if that makes any
> difference. I guess I don't understand exactly what information apache
> uses to select the virtual host. I
> though it was something in the http request that was sent by the client,
> but I could be wrong. As for the
> back-slashes mentioned in the other response, I don't think they are an
> issue on a windows box, they've
> always worked fine for me.
>
> I think I'll try to sniff some packets with and without the dynamic dns
> and see what changed.

No need to sniff packets.  Just look at the source of the page that your
clients are seeing.  If you see the IP address of your box (which I am
sure you will), then that is what the clients will be accessing, and that
is what apache will be seeing.  Clearly there is no way to do virtual
hosts like this.

Joshua.

---------------------------------------------------------------------
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] Problem with multiple virtual hosts and dynamicdns

Posted by Brian Dessent <br...@dessent.net>.
Gregg Donley wrote:

> difference.  I guess I don't understand exactly what information
> apache uses to select the virtual host.  I
> though it was something in the http request that was sent by the
> client, but I could be wrong.  As for the

You are correct, it knows which virtual host to serve based on either
the "Host:" field sent by the client (HTTP/1.1) or the host portion of
the URL (HTTP/1.0).  If neither of these is present, it must revert to
the default domain as it has no way of knowing which virutal server the
client is referring to.  Running Ethereal (or whatever) will definitely
tell you if it's an Apache problem or not, since the headers will all be
right there.  I also suggest you get friendly with some of the command
line tools such as 'wget' or 'curl' which can be invaluable for
debugging such things.  They can print all the HTTP headers for a
session, they can be told not to follow HTTP redirects, and they
(naturally) do not know anything about framesets or any other
redirection done in the body of the page.  Therefore it's very easy to
figure out exactly what's going on and how the redirects are doing what
they're doing.

Brian

---------------------------------------------------------------------
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] Problem with multiple virtual hosts and dynamic dns

Posted by Gregg Donley <gr...@nvsys.com>.
Thanks Joshua and Jeff for the responses. My domains are registered 
though registerfly and they provide
what they call "URL Framing" but I am not sure about the specifics of 
how that works. The dynamic dns
I am currently using is though tzo.com, but I have considered trying 
some others so see if that makes any
difference. I guess I don't understand exactly what information apache 
uses to select the virtual host. I
though it was something in the http request that was sent by the client, 
but I could be wrong. As for the
back-slashes mentioned in the other response, I don't think they are an 
issue on a windows box, they've
always worked fine for me.

I think I'll try to sniff some packets with and without the dynamic dns 
and see what changed.

Thanks for the replys.

Gregg


Joshua Slive wrote:

>On Fri, 25 Jul 2003, Gregg Donley wrote:
>
>  
>
>>I have three domains for which I am hosting websites on my windows box.
>>All three domains
>>use url framing to point to the same dynamic dns host.  The problem is
>>that apache seems
>>unable to distinguish between the three domains and access the correct
>>virtual host container, it
>>sends them all to the default virtual host.  Creating an additional
>>virtual host with the name of the
>>dynamic dns host confirms that apache is seeing that host name rather
>>than the host specified by the
>>client.  Is this the expected behavior?  It there a way to have multiple
>>domains point to the same
>>dynamic dns host and still have apache distiguish between them and
>>direct them to different
>>virtual hosts?
>>    
>>
>
>You need to describe exactly how the url framing and "pointing" is
>working.  There are many variations on this.
>
>>>From your description, I would guess that the domains don't actually point
>at your server; they point at another server that then sends a frameset
>which in turn sources a frame using your IP address.  If this is true,
>then it will not work with virtual hosts.
>
>Look at it from apache's perspective.  All apache sees is the request
>coming in on the IP address.  There is no way for apache to know that the
>original request was from a different hostname.
>
>Joshua.
>
>---------------------------------------------------------------------
>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] Problem with multiple virtual hosts and dynamic dns

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 25 Jul 2003, Gregg Donley wrote:

> I have three domains for which I am hosting websites on my windows box.
> All three domains
> use url framing to point to the same dynamic dns host.  The problem is
> that apache seems
> unable to distinguish between the three domains and access the correct
> virtual host container, it
> sends them all to the default virtual host.  Creating an additional
> virtual host with the name of the
> dynamic dns host confirms that apache is seeing that host name rather
> than the host specified by the
> client.  Is this the expected behavior?  It there a way to have multiple
> domains point to the same
> dynamic dns host and still have apache distiguish between them and
> direct them to different
> virtual hosts?

You need to describe exactly how the url framing and "pointing" is
working.  There are many variations on this.

>From your description, I would guess that the domains don't actually point
at your server; they point at another server that then sends a frameset
which in turn sources a frame using your IP address.  If this is true,
then it will not work with virtual hosts.

Look at it from apache's perspective.  All apache sees is the request
coming in on the IP address.  There is no way for apache to know that the
original request was from a different hostname.

Joshua.

---------------------------------------------------------------------
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] Problem with multiple virtual hosts and dynamic dns

Posted by Jeff Cohen <su...@gej-it.com>.
First of all, I would suggest you to use the apache -t command to check your
config, you are using back-slashes for directories - which is already
invalid configuration.
Second thing, if you would tell which DDNS you are using we might be able to
help you in configuring it so you can forward a request to that IP you are
using and not to the absolute FQDN of the D-domain that you are using.

All the best,

Jeff Cohen
Support@GEJ-IT.com
Tel. (416) 917-2324
www.GEJ-IT.com
GEJ-IT Networks!



> -----Original Message-----
> From: Gregg Donley [mailto:greggd@nvsys.com]
> Sent: Friday, July 25, 2003 11:20 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Problem with multiple virtual hosts and dynamic dns
> 
> I have three domains for which I am hosting websites on my windows box.
> All three domains
> use url framing to point to the same dynamic dns host.  The problem is
> that apache seems
> unable to distinguish between the three domains and access the correct
> virtual host container, it
> sends them all to the default virtual host.  Creating an additional
> virtual host with the name of the
> dynamic dns host confirms that apache is seeing that host name rather
> than the host specified by the
> client.  Is this the expected behavior?  It there a way to have multiple
> domains point to the same
> dynamic dns host and still have apache distiguish between them and
> direct them to different
> virtual hosts?
> 
> Thanks.
> 
> NameVirtualHost *
> 
> # Default - seems to catch everything if the dyn_dns virtual host is
> omitted
> <VirtualHost *>
>  ServerName default
>  DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs"
>  ScriptAlias /cgi-bin/ \
>               "C:\Program Files\Apache Group\Apache2\cgi-bin/"
>  ErrorLog     "C:\Program Files\Apache Group\Apache2\logs\error.log"
>  CustomLog    "C:\Program Files\Apache Group\Apache2\logs\access.log"
> common
> </VirtualHost>
> 
> # First domain
> <VirtualHost *>
>  ServerName domain1.com
>  ServerAlias *.domain1.com
>  DocumentRoot "C:\Program Files\Apache Group\Apache2\domain1.com\htdocs"
>  ScriptAlias /cgi-bin/ \
>               "C:\Program Files\Apache Group\Apache2\domain1.com\cgi-bin/"
>  ErrorLog     "C:\Program Files\Apache
> Group\Apache2\domain1.com\logs\error.log"
>  CustomLog    "C:\Program Files\Apache
> Group\Apache2\domain1.com\logs\access.log" common
> </VirtualHost>
> 
> # Second domain
> <VirtualHost *>
>  ServerName domain2.com
>  ServerAlias *.domain2.com
>  DocumentRoot "C:\Program Files\Apache Group\Apache2\domain2.com\htdocs"
>  ScriptAlias /cgi-bin/ \
>               "C:\Program Files\Apache Group\Apache2\domain2.com\cgi-bin/"
>  ErrorLog     "C:\Program Files\Apache
> Group\Apache2\domain2.com\logs\error.log"
>  CustomLog    "C:\Program Files\Apache
> Group\Apache2\domain2.com\logs\access.log" common
> </VirtualHost>
> 
> # Added virtual host for dynamic dns host which, if present, gets all
> request.
> <VirtualHost *>
>  ServerName dyn_dns.com
>  ServerAlias *.dyn_dns.com
>  DocumentRoot "C:\Program Files\Apache Group\Apache2\dyn_dns.com\htdocs"
>  ScriptAlias /cgi-bin/ \
>               "C:\Program Files\Apache Group\Apache2\dyn_dns.com\cgi-bin/"
>  ErrorLog     "C:\Program Files\Apache
> Group\Apache2\dyn_dns.com\logs\error.log"
>  CustomLog    "C:\Program Files\Apache
> Group\Apache2\dyn_dns.com\logs\access.log" common
> </VirtualHost>
> 
> 
> 
> ---------------------------------------------------------------------
> 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