httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DL Neil" <>
Subject Re: Using multiple virtual hosts?
Date Sat, 20 Apr 2002 07:53:37 GMT

I wasn't anxious to jump into this conversation because there seemed to
be a flurry of msgs, they seemed to have more to do with Windows (than
Apache - which on some lists would lead to protests of "off-topic" - so
thanks to the members for their patience!), and worse was/is that all
the 'solutions'/discussions seemed to be heading off in different
directions. I only became involved because at least one respondent was
giving incorrect advice (for Windows at least).

A second criticism is that your replies (in good English BTW) are brief
to the point of being too short on detail. This approach tends to leave
your assistants guessing or suggesting two or three alternatives/making
broad suggestions, because there is not enough information to narrow
things down (ie you're making us work too hard). Please be sure to
respond to each suggestion/question methodically.

Please bear in mind that many/most of us do not keep a record of 'old'
emails but delete them once read, so whilst you have all the
facts/experimentation in your head, we probably do not (and probably
need to be told, again...)!

Finally, at the risk of sounding totally pompous, may I suggest that you
slow down. You apparently need to organise your Windows system before
you will ever get Apache to work to your satisfaction. Perhaps do a bit
of background reading, particularly on topics like Windows networking,
and the Domain Name System...

If you have slowed down/taken a deep breath (and are still reading!?),
please be advised that I have assumed that you know even less than I do
about this networking (and I'm no rocket scientist). If this assumption
is not true and I appear to be insulting your intelligence, I apologise.

BTW I've put this msg back on the list, in case I do reveal my ignorance
and someone wiser will offer a correction!

> Hi. Thank you for answer.
> I tried the same thing but it doesn't work.

=I'm sorry to hear this. It does on my system (WinNTWS 4.0 SP6a),
whether I am running standalone (its a portable), connected to a
local/home server, connected to clients' office servers, and/or
connected to the Internet. The "thing" was:
This is my C:\WINNT\system32\drivers\etc\hosts. file:       localhost pit collab ml md webs docs

Where each of the terms after "localhost" is a VHost in the Apache CONF
file. (technically so is localhost, I just don't ever use it)

> I put in the hosts file:
> I also tried with
> ll
> ... but with the same results.
> If I put "localhost" instead, it works with any problem.

If you review my hosts. file you will see that the IP address
is defined for a whole list of network addresses. In your examples above
you only use one name at a time. Have you tried:       localhost ll

FWIW I only edited the 127 line in my hosts. file - I didn't re-type it.
I think the first character after the IP address (and before the names)
is a tab (not a bunch of spaces). However I don't know if that makes any
difference, or if it is only done for readability!

> If I use anything else, when I type that address in Internet Explorer,
> opens the local page as it should.
> But if I press F5 to refresh the page, it tells me that I work offline
> it asks me if I want to connect to internet.
> If I choose "connect" it opens the dial up connection.
> If I choose "Work Offline" or I don't refresh the page, I can't use
any link
> on the local page because it tells me again that I am working offline
and it
> asks me if I want to connect to internet.

In the same way that I am not talking about Apache at this time, I
suggest that you leave IE alone, and work only with networking tools,
such as PING (that you mention below).

> ... and I should be able to use something like:
> in the hosts file because this is my network address.

I agree, so if it is not defined anywhere else, add the 192 line to
hosts. underneath the 127 line. However you can't have the teddy (etc)
name defined twice/resolving to more than one IP address, so you need to
make up your mind which to use (I recommend ignoring the 192 line for
now). It seems to me that the 192 address should be the name of the
machine NOT the name of the test/simulated web site/Internet address.
Referring back to the 127 line above, none of those web site 'names' are
the name of my machine - that is defined with Control Panel | Systems |

Perhaps it would be best to put 192 aside at first, and get things
working for 127 first!? Then you can start 'adding' complexity, and
retesting - and if necessary 'subtracting' to get back to a working

> Oh, and I've discovered another big problem.
> If I ping from my local computer, it tells me that the
host is
> unreachable.
> This is the local address and in the device manager all seems to work
> properly.
> Do you have any idea what could be the problem with this?

I am not an NT/2000 Network Administrator. I have some experience, and
run my own 'network' at home. If any of my advice conflicts with that
from your ISP or any local administrator, then please do not carry it

On Windows, the hosts. file is only read at boot time, as part of the
machine's network awareness/setup. On that basis let me ask if after
EVERY update to the hosts. file, did you perform a reboot after every
edit? Boy does this make network 'tweaking' a painful and boring process
(especially on an old, slow machine like mine) - but there is no

Why don't you edit the hosts. file, as described, perform a reboot, open
a DOS box (Command Prompt), and try PINGing If that works,
try PINGing the various alpha-names to see if they resolve to a
dotted.IP address ( correctly.

If it causes your dialer to spring into action, cancel the dialer. From
the DOS prompt try TRACERT and we'll see if you get anything
usable before that fails...

Please report back (if you can copy-paste the DOS window session it will
save typing/provide us with the most accurate observations/information).

If the above still doesn't work to your satisfaction, then it is time to
fill us in on a bit of background/the underlying Windows networking

You have talked about accessing the Internet by "dial up" connection.
You also talk about having a "network address". So let's talk about the
nitty gritty of those.

1 ISP: is your Internet connection configured so that when you
dial/connect with the ISP, that computer allocates your machine a
temporary IP address - or do you have the same fixed address to use at
all times? (the former is most likely, but how are things done in .ro?)

2 Network: you also talk of having a network address (192...): what
network is your machine connected to? How is the allocation of IP
addressing handled within the network (is DHCP used, or does each
machine have a fixed IP address)? What kind of server controls the
network? (Assuming Windows) Is it configured as a domain or a workgroup?
Is your machine a client, a server, or both?

3 Your PC's network: are you running a full network facility or
Microsoft's shared modem/dial-up networking lash-up? Is the modem
directly attached to your machine, or located/shared somewhere else on
the network? Is it a 'real' analog modem, eg 33K6 or 56K, or is it some
sort of router/set-top box?

4 Your PC's network settings: please relate your machine's settings
under Settings | Control Panel | Network. We'll be interested in what
appears on the Identification tab. Then move to the Protocol tab. How
many protocols are listed there? Select TCP/IP and click on Properties.
Please advise these settings (including "Advanced")
- one of your other recent correspondents asked about your "Gateway"
setting, which may appear here!

5 Local name files: Microsoft enables the use of two of these: hosts.
(which you have met) and lmhosts (which you may not - same
sub-directory). Please advise the total contents (except comments) of
both of these.

BTW hosts. corresponds to a DNS server whereas lmhosts. corresponds to a
WINS server.

-you will recall that there has been a lot of discussion about "DNS" in
responses to you - whether you need it, whether you need your own
server, or not, etc, etc. If your machine is not connected, then name
resolution can only be handled by the hosts. (or for M$ machines, the
lmhosts.) file(s). If you connect to a local network, then there may be
some central name resolution server, eg DNS or WINS or M$ Shared Modem.
This will either have to integrate with, or replaces the use of local
(lm)hosts. file(s). Similarly/additionally, when you dial the
ISP/Internet, external names will be resolved on external name servers -
all three levels of names/name serving now needing to integrate happily
(and without ambiguity). That is why attention to these details is

-at the same time, there is an address allocation activity. When your
machine is stand-alone, it probably doesn't need any names (until you
start using Apache vhosts)! Thus the hosts. file can be used to equate
"localhost" to "" and vice-versa. When it is connected to a
network (local or Internet) your machine now needs both a name and an IP
address - it can't be called or "localhost" by another
machine, because that would cause the machine to talk to itself, not
your box! So now we can introduce into the discussion.
Somewhere there has to be a statement that your machine's name is to be
equated to that IP address. This can take place within every machine's
(lm)hosts. file (a real chore on larger networks), or by using an
address server. Both a local network and an ISP likely use a DHCP server
to accomplish naming - establishing the relationship between machine
name and IP address, and advising this information to your machine
during the network logon process.

I suspect there is one (maybe two) small but fundamental item(s) missing
in your system's config. Once they're identified, everything will
quickly fall into place for you!

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

View raw message