This text describes how to run your WWW server without a TCP (Internet) connection.
There are many times when you may want to run your WWW server even though you are not directly connected to the Internet. For example, you may be giving a presentation. You may be at home without a connection. Your Internet provider happens to be "down."
At first glance, since your WWW server depends on the Internet (more specifically the transmission control protocol or TCP) to communicate with client applications, you may think it is not possible to run your WWW server without an Internet connection. This is not true. While it is true that without an Internet connection you will not be able to communicate with others on the Internet, you will be able to run our WWW server locally.
The "trick" is in configuring your MacTCP control panel document in a special way. This technique was first illustrated by Grant Neufeld in his documents "Running MacHTTP Locally Without A Network" and "Using TCP on a LocalTalk Network." Full and complete credit is given to him for these ideas.
To run your WWW server on your local computer without an Internet connection, follow these steps:
When the configuration is complete, your MacTCP control panel should look very similar to the dialog boxes below.
- 1. Make sure AppleTalk is turned on.
- AppleTalk is the Macintosh's native networking protocol. Make sure it is turned on by opening your Chooser and selecting the Active button. You may have to restart your computer to complete this part of the process.
- 2. Configure MacTCP for AppleTalk communications.
- Open your MacTCP control panel document. One of the icons presented there will be LocalTalk. Select the LocalTalk icon. This tells MacTCP to get its Internet configuration via the AppleTalk protocol.
- 3. Give yourself a gateway, address class, and name server designation.
- Click the More... button. From the resulting dialog box:
- Select Manual from the "Obtain Address" section
- Enter 0.0.0.0 for your gateway address
- Select C as the class
- Make sure the there is no information in the Name Server section
These settings tell our Macintosh that you have a static IP address (Manual), but you don't have a gateway. Your address class is C, and you don't use a name server (a database of Internet names).
- 4. Assign yourself an IP number.
- Close the dialog box by clicking the OK button. Finally, give yourself an IP number. Specifically, give yourself an IP number that is a class C address. Grant suggests 220.127.116.11. Again, you may have to restart your computer in order for the changes to take effect.
After the changes have taken effect (this may be after you restart), you can launch your WWW server and it will think it is connected to the Internet. More importantly, you will now be able to access our WWW server normally except you will have to connect to it via it new IP number. Again, to use this new configuration, you will have to access your server through the proper IP number, namely 18.104.22.168 or what ever IP number you assigned yourself in Step #4 above.
There are at least two caveats with this procedure. First you must tell your WWW server not to do DNS (domain name server) look ups. By not doing so, your WWW server will try to resolve IP numbers can cause problems. Second, CGI scripts that return referer information will not work. This includes imagemapping programs like MapServe and Mac-Imagemap. This happens because the IP address passed by your client application to the server is not quite valid. This incorrect information is then passed on to the CGI script in turn being passed back to you. Its a vicious circle.
The process of moving back and forth between various MacTCP configurations can be tedious. Luckily there is a utility call MacTCP Switcher that can save MacTCP configurations and update them. You may find this utility indispensable if you tend to "trick" MacTCP often.
This page was first published on September 26, 1995. Feel free to send comments.