Page 1 of 1

NameVirtualHost - IP not resolving to ServerName

PostPosted: 09. January 2010 19:01
by MegaMav
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?

Re: NameVirtualHost - IP not resolving to ServerName

PostPosted: 09. January 2010 19:15
by Wiedmann
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.

Re: NameVirtualHost - IP not resolving to ServerName

PostPosted: 09. January 2010 19:33
by MegaMav
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.

Re: NameVirtualHost - IP not resolving to ServerName

PostPosted: 09. January 2010 22:39
by Wiedmann
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.

Re: NameVirtualHost - IP not resolving to ServerName

PostPosted: 09. January 2010 23:08
by MegaMav
Thank you for your time and expertise.