Webserver LAN

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi,

My LAN uses a broadband router (Origo 8100) with 2 client machines one
of which is a web server running Apache.

The server works great and accepts http request perfectly via port
forwarding configured in the routers setup.

However if I use my other machine on the network to call a page hosted
on the server via external ie. http://www.mywebsite.com - I do not get
the correct the pages, instead I get the router's login panel, the
request is obviously not forwarded to the server. Other requests to
sites not hosted on my server work fine. Also if I use the internal IP
address of the server (10.0.0.4) I do see the sites as expected.

Any ideas?

Many thanks,

Rob B.
 
Rob said:
Hi,

My LAN uses a broadband router (Origo 8100) with 2 client machines one
of which is a web server running Apache.

The server works great and accepts http request perfectly via port
forwarding configured in the routers setup.

However if I use my other machine on the network to call a page hosted
on the server via external ie. http://www.mywebsite.com - I do not get
the correct the pages, instead I get the router's login panel, the
request is obviously not forwarded to the server. Other requests to
sites not hosted on my server work fine. Also if I use the internal IP
address of the server (10.0.0.4) I do see the sites as expected.

Any ideas?

Many thanks,

Rob B.


This will happen with most broadband routers, they won't permit 'loopback'.

In otherwords, you cannot access one internal machine from another via the
external address.

The fix is for you to add a line in your hosts file to point
http://www.mywebsite.com
to the webserver's internal IP address, 10.0.0.4
 
Ron,

Thanks for the help, I am not quite clear what my hosts file is, how
would the line look roughly?

Thanks,

Rob.
 
Thanks for the help, I am not quite clear what my hosts file is, how
would the line look roughly?


Go to a command prompt ( 'dos window' ), and type:

cd c:\windows\system32\drivers\etc\
notepad hosts. <- be sure to put a dot at the end.

The default hosts file will have one entry:

127.0.0.1 localhost.

Add a line like this:

10.0.0.4 www.yoursite.com

and save it.
 
Rob said:
Ron,

Thanks for the help, I am not quite clear what my hosts file is, how
would the line look roughly?

Thanks,

Rob.

Here's how to find your hosts file:

1. In XP's Search preferences, set the files and folders handling to
Advanced, and then check the box that will make Search look in hidden
files/folders. If you don't have XP, just use the regular Find Files &
Folders.
2. Now enter the search term "hosts" without the quotes.
3. When you find the hosts file, double-click it to open it. In XP,
you'll get a Windows dialog box saying that Windows cannot open this
file, do you want to use the web or select from a list to find the
proper program. Choose "select from a list" and highlight Notepad. Make
sure the box to always use this program to open this type of file is
not checked.

Type in the lines as Ron Lowe told you and then Save the file and close
it.

Mlake
 
Thanks this works perfectly I can now call the pages on my webserver
fom within my LAN. Would anyone care to briefly explain to me briefly
how this works?

Thanks,

Rob.
 
Rob said:
Thanks this works perfectly I can now call the pages on my webserver
fom within my LAN. Would anyone care to briefly explain to me briefly
how this works?

Thanks,

Rob.



The browser needs to perform Name Resolution to convert the name to an IP
address. Normally, it would call upon DNS for that. DNS would return the
external address, which is fine for the rest of the world, but is not going
to work for you. The hosts file is checked first before DNS, so an entry
here will over-ride what DNS says. So your machine gets the HOSTS over-ride
of 10.0.0.4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top