Forum OpenACS Q&A: Response to why cannot see the pages outside of my machine?

Posted by S. Y. on

The whole point of DNS and NIS (formerly YP) to prevent having to use a local file (/etc/hosts) and make network administrators' lives easier. However, putting IP addresses and hostnames in local files (e.g., /etc/hosts) works great if you've set up your own internal network, etc. That's why in /etc/nsswitch.conf you can see that hostnames can be resolved in a variety of ways (files, nis, dns).

Typically DNS is used to communicate information about domains, hence its name. NIS is used within organizations once network administrators get tired to managing a master /etc/hosts file that needs to be rcp/scp'ed to other machines; maybe this is thirty or forty machines or when a second subnet gets thrown in.

The basic reason for having hostnames in the first place is to make it convenient for humans to remember, i.e., so you don't *have* to type in IP addresses.

A sample master /etc/hosts:  router gateway gw mail smtp server www web workstation1 ws1 john workstation2 ws2 chris laptop1 lt1 jane laptop2 lt2 pat laptop3 lt3 sam printer laserjet lj

Note that in the above example, I deliberately matched computer "IDs" (e.g., workstation1) with the last digit of its IP address. If I had mismashed the entire thing, it gets harder to remember.

In isolated networks at conferences I've used state names plus a few cities (we actually had fifty clients plus a few miscellaneous admin/instructor boxes). alabama al alaska ak arizona az
    ... sanfrancisco sf sanjose sj chicago

We actually put this file on a master drive (along with demo content, etc.) and cloned the entire drive as prep work. Boot single user, change the appropriate networking stuff, and boot up multi-user under the correct individual hostname/IP address.

Also I've done this stuff on a limited basis with /etc/passwd and /etc/group as well.

This is basic TCP/IP networking stuff that is covered in any *nix system administration manual. None of this is Web specific; it's just basic networking. Assuming you haven't disabled these services, you should be able to ping, traceroute, and (maybe) telnet to machines in your network by IP address and hostname. If you can't, your network is misconfigured, not your web server.

Note on AOLserver: if left undeclared, nsd (just like Apache) will listen on all configured network interfaces, and on all IP addresses. The main reason is declare IP addresses, etc. is to make sure that the web server doesn't listen on a particular interface (e.g., a second Ethernet card). That's also why if you're running the nscp module, that you have it configured to only listen on localhost, forcing you to telnet/slogin to the server, and (hopefully), confirming that you're a legitimate user and not some random loser.

It's helpful to play with a small 2-3 machine network setup; by learning the concepts of basic and correct TCP/IP networking, you will find that your local network will be a much easier place to inhabit.