Page 1 of 1

Newbie, Virtual sites in Apache Why IP works but name dozen?

PostPosted: 23. May 2004 03:33
by Dick
Newbie to Virtual sites in Apache – ( httpd.conf)

I am trying to understand how it all works, I have the following config in my httpd.conf file: I can load the site using the a IP address e.g. 192.168.1.10 in the URL – ( http://192.x.x.x. etc but when I go to use the site name it will not show? Do I have to have a register domain name to make this work?

# Project Your IT connection
<VirtualHost 192.168.1.10:80>
DocumentRoot E:/xampp/htdocs/yitc
ServerName yitc.yitc.com
#ServerAdmin dick@exemail.com.au
#ErrorLog logs/yitc.yitc.com-error_log
#CustomLog logs/yitc.yitc.com-access_log common
#ScriptAlias /cgi-bin/ /www/localhosts/yitc/cgi-bin

</VirtualHost>


I have been try different way to get this to work but I am not having much luck!


I would be grateful for any suggestion to help me with this problem.

Dick

PostPosted: 23. May 2004 10:44
by Wiedmann
Apache needs to use reverse DNS to find the ServerName for the virtualhost. If that reverse lookup fails then it will partially disable the virtualhost.
Also your client pc needs the correct ip for a given DNS-name, too.

A simply way is the editing if the file "hosts" in "\windows\system32\drivers\etc".

Newbie to Virtual sites in Apache – ( httpd.conf)

PostPosted: 24. May 2004 02:22
by Dick
Thanks very much!

How simple was that to do! I was trying for two days to get that working going around and around getting no where fast. thank again


dick