Re: Re: Help - Name Server - Maybe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric:
 
My email utility sent you to the junk mail folder and I didn't see you until now.  Next I am suffering this morning from severe pain and the morphine is not helping so I may not respond back right away.  My pain may be for a couple of hours or in might be for days.
 
I do know that my computer works with IP address and not names.  I know that I am having a router problem.  some that are helping here can get to my modem but that is as far as they get.  That?s the problem that I need to resolve.
 
Right now the machine that has the Apache on it has an IP address of 10.0.0.115.  I found the host file.  Am I to understand that I should put 10.0.0.115  www.michaelsrogers.com in the file right under the 127.0.0.1  localhost
Sent: Sunday, February 01, 2009 3:31 PM
Subject: Re: Re: Help - Name Server - Maybe

Eric Covener wrote:
[...]

>
> FWIW It's quite common to not be able to access your webserver with
> it's external IP address from within your LAN.
>

Allright, I'll try to help.  This has not much to do with Apache, and
more with basic TCP/IP.  So let's start at the beginning.

First your internal LAN.

I) computers work with IP addresses, not with names.  That may surprise
you, but it is so.
When you tell your browser to get "www.google.com" :
- it first looks in its own local "hosts" file to see if there is a
translation for "www.google.com" into an IP address like 1.2.3.4
The local hosts file can be found :
under Unix/Linux, in /etc/hosts
under Windows, in windows\system32\drivers\etc\hosts
- if the local hosts file does not provide a translation, then your
browser asks "the DNS system".  That is something complicated, but
basically it means that it will need the IP address of another computer
known as a DNS Server, and it will send a message to that IP address,
asking for the IP address of "www.google.com"
- if the browser cannot find finally an IP address for www.google.com
with any of the above, it gives up and tells you so.

II) where your local computers get their own IP address :
there are 2 ways :
- either they are set up with a fixed IP address
- or they are set up to ask a DHCP server to give them one. For this
second possibility, the computer (usually when it starts), sends a
special "broadcast" message on the local network, asking if a nice DHCP
server would please give them a new IP address.  If any DHCP server is
listening on the local network, it will consult its internal tables to
see which address it could give (it has a range of addresses), among the
ones which are still free (if it has already given an address away, it
will not give it away a second time).
That is why, when you turn off your DHCP server, your stations are not
working anymore : because they are set up to request an IP address from
a DHCP server, and there is none active, so they don't get one.  And if
they do not have an IP address themselves, they cannot use TCP/IP and
thus their Internet access doesn't work anymore.

III) A workstation can use a variable IP address given by a DHCP server,
but a server should have a fixed IP address.

That is because for a workstation it does not matter : nobody will try
to find it, it just needs to find the others.
But for a server, it's different : other stations need to find it, so it
better have an address that does not change all the time.
(For the same reason that you can make a phone call to someone else from
any phone, but if someone needs to reach you, they need your number).

A part of your problem, is that you are trying to turn a workstation
into a server (an Apache server).  So you have to stop it from getting a
variable IP address, and give it a fixed one.
But, you have to pick an IP address which on the other hand, your DHCP
server will not give away to someone else.
(Because two stations having the same IP address confuses everyone and
does not work).
So you need to look in your DHCP server which range of addresses it is
giving away, and pick one outside that range (just add 1 to the last
number in the DHCP range).(at the end, not at the beginning).
(If your DHCP server is also your router, it may have a web interface to
make it easy.  If it is not the router but some server, then this may be
more complicated).
Now when you have done that, try from another station to access your
Apache server at the fixed IP address that you gave it.

For example :
- suppose your DHCP server is programmed to give away addresses in the
range 192.168.1.100 - 192.168.1.150 (51 addresses)
- suppose then that you gave your Apache workstation the fixed address
192.168.1.200 (to be well outside of the above range).
- then try "http://192.168.1.200" (from another internal station)

If you get a response from Apache, then we are already well on the way.

Next, we want all the internal stations to be able to access this Apache
server, not by IP address, but with a name.  That is easier for humans.
Read Chapter I above, again, to remember how they do that.

Unfortunately, there probably isn't a DNS server on your local network,
that could be used by the internal stations.
Thus you will have to use the "hosts file" method.
On one of the workstations, locate the hosts file, and add the following
line in it :
192.168.1.151 some.nice.name
then close all browser windows on that workstation, re-start the
browser, and type "http://some.nice.name".
If everything worked according to plan, you should get the same Apache
page as before.
Now do the same on all the other workstations, et voila you have an
internal webserver. (You might want to find a nicer name than
"some.nice.name", like "www.apache.local" e.g.).

In the next installment, we'll look at the external access to your
webserver.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

Michael S. Rogers
(406) 967-2385
 
Web Sites: http://www.michaelsrogers.net & http://www.michaelsrogers.net/trainwreck/Wreck.html

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux