httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif W" <>
Subject Re: [users@httpd] Setting up a virtual host on a stand alone Windows 2000 machine
Date Wed, 29 Dec 2004 07:42:19 GMT
Responding out of order as things are re-prioritized.

> Posta Kutusu; 2004 December 28 Tuesday 16:51
> (I have also
> experimented with adding :8080 to the address).  I have edited the the
> httpd-conf to include a section for <virtual host
>>  container and provided a DocumentRoot,
> TransferLog, ServerName, etc.

Apache config for the domain is pointless until you get the domain name 
working.  Furthermore, you should be using the IP:PORT pairs that you 
will be listening to, never the host name, as it may incur one or more 
DNS lookups every time the server receives a request.  Put the host name 
only in the ServerName hostname:port value.

> Now I want to set up a virtual host using a root directory
> c:/www/

Normally I prefer one more level for the DocumentRoot.  As a rule of 
thumb, if I don't want someone to look at the file, I don't put it in 
the document root, just incase I forget to disallow access later.  So 
I'd have C:/www/hostname/ with folders: logs, public, cgi, and so on, 
and make the public the DocumentRoot, and the cgi a ScriptAlias, and so 

Verbose descriptions of Windows 2000 network configs which may be 
outside the scope of Apache user config help.  ;-)

> via a local address, say  I have
> edited the 'hosts' file under my winnt/system32/drivers/etc directory
> to include the line

First get your network config working.  Verify that your host name 
resolves to the correct IP address.  At the very least, you can try to 
ping the host name, and see if it resolves to the correct IP, regardless 
of wether the packets get a response.  Further description using better 
DNS tools is given below.

> My machine detects a local area
> connection via a 3Com ethernet card, which enables DHCP.  My problem
> is that my browser cannot connect to the site: the connection is
> refused/not found.  I gather that somehow I need to take other steps
> to assign the IP address to my interface.  How do I do that? I've
> tried disabling NetBios over TCP/IP but that does not work.  I hope
> not to have to read volumes of material on Windows networking and DNS
> to discover the adjustment I need to make.

First of all the IP address must be assosciated with some 
network card or device.  ipconfig /all should be helpful as a start. 
Otherwise it's way off topic.  Second, the DNS must know that it has to 
look first in the C:/WINDOWS/system32/drivers/etc/hosts file before 
asking a name server.  Normally I think it does this, as it has done 
this in all my experience in the past.  However I have realized that for 
my current setup it is simply not working at all, so I have no idea what 
to do in that case.  Normally I use an "edge DNS" where I put my own 
caching DNS server in place (dnsmasq), and have it read from a hosts 
file, and deliver local IPs to local machines, and query and cache my 
ISP's DNS for everything else.  Thirdly configure Apache, and be sure to 
Listen to all IP:PORT pairs your hostnames will resolve to, set the 
NameVirtualHost for each IP:PORT pair (except SSL), and use the list of 
IP:PORT pairs in each VirtualHost, and use the hostname:PORT in each 
ServerName directive.  Don't forget to specify the PORT everywhere!  It 
may often work without but it can bite you later.


To query the DNS directly without getting into the verbose ping, is to 
use the host.exe program.  This program along with many other basic 
networking programs widely used in other OSes which connect to the 
internet have never been included with any Microsoft OS product, up to 
and including XP SP2.  Fortunately someone has gone to the trouble of 
compiling these for Win2k/WinXP and offers them for download here: .  Unfortunately there's no single zip, 
and no slick intaller.  But it's not all bad.  Just get the .exes, 
.dlls, and .confs.  Put into C:\bin or C:\bin\dns (or wherever you 
want), and optionally add that path to the PATH environment variable 
(temporarily or permanently).

@REM Temporary

Successful usage should look like this:

[2004-12-29@ 2:08:05] C:\ -> C:\bin\dns\host has address


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message