NameVirtualHost - IP not resolving to ServerName

Problems with the Windows version of XAMPP, questions, comments, and anything related.

NameVirtualHost - IP not resolving to ServerName

Postby MegaMav » 09. January 2010 19:01

Alright, Im at the end of my rope :D

Ive come here for help, if possible, because im not sure what else I can do.
Or, even if what im trying to do is possible.

I secured a domain name, and forward all traffic from my domain registrar to my webserver at home by IP.
I have Apache 2.2 set up, with virtual hosting.

from httpd.conf

Code: Select all
# Virtual hosts
Include conf/extra/httpd-vhosts.conf


from httpd-vhosts.conf

Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/XAMPP/HTDOCS/"
ServerName [MYHOSTNAME].com
</VirtualHost>


Now, shouldnt the IP address be replaced/resolved by [MYHOSTNAME].com when users are redirected?
Am I doing something wrong here, or is this not working as I'm expecting it to?
MegaMav
 
Posts: 3
Joined: 09. January 2010 18:45

Re: NameVirtualHost - IP not resolving to ServerName

Postby Wiedmann » 09. January 2010 19:15

forward all traffic from my domain registrar to my webserver at home by IP.
Code: Select all
NameVirtualHost *:80

Now, shouldnt the IP address be replaced/resolved by [MYHOSTNAME].com when users are redirected?

Namebased vhosts are only working, if the browser is using a hostname for the request.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: NameVirtualHost - IP not resolving to ServerName

Postby MegaMav » 09. January 2010 19:33

Thanks for the fast response, in short, is there anything reasonable I can do to get the IP to resolve to the named address virtually through apache?
Im using Windows 2000 Advanced Server.
MegaMav
 
Posts: 3
Joined: 09. January 2010 18:45

Re: NameVirtualHost - IP not resolving to ServerName

Postby Wiedmann » 09. January 2010 22:39

is there anything reasonable I can do to get the IP to resolve to the named address virtually through apache

An ip request is always going to the first defined vhost (the default host). There is nothing in Apache which is doing a reverse lookup.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: NameVirtualHost - IP not resolving to ServerName

Postby MegaMav » 09. January 2010 23:08

Thank you for your time and expertise.
MegaMav
 
Posts: 3
Joined: 09. January 2010 18:45


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 202 guests