Macintosh Web Server
Volume Number: 11
Issue Number: 5
Column Tag: World Wide Web
Your Very Own Web Server - MacHTTP
Take Five Minutes and Join the Web
By Jon Wiederspan, jonwd@tjp.washington.edu
[Remember that excitement the first time you ever saw a Macintosh? How about that
first week after you got your hands on one? I don’t - I simply dove in and resurfaced
days later, grinning from ear to ear. From time to time, we come across technology
tools which evoke such reactions. Serving up pages on the World Wide Web seems to
have this effect on some people.
In this article, Jon introduces us to MacHTTP, a Macintosh server. It couldn’t be
easier, nor could it be any more addictive. In addition to job-security warnings, and
tips on getting along with un*x admins, he also gives us a preview of the 3.0 version
(coming soon), and shares tips on how to get the most out of your Web site. You don’t
have one yet? Odds are good that, after reading this article, you will! Enjoy! Let us
hear from you about your experiences, and send us your URLs - Ed stb,
editorial@xplain.com]
Like most people on the Internet, I have only recently been introduced to the World
Wide Web. It was less than two years ago, that fateful day when I downloaded a copy of
Mosaic from the UMich ftp site. One double-click and I was launched into hypermedia
heaven, madly clicking my way around the globe, heedless of restrictions like server
addresses and directory paths that I had accepted without question for years in my FTP
client. The memory already fades, so I don’t recall exactly whether I rushed right over
to show it to my friends or whether I waited a few minutes first to get a drink of water.
Either way, though, it was not long before we were engrossed with ideas of what we
could do with our own World Wide Web server.
That is when reality slammed me rudely back to earth. Yes, I had a Sun
workstation and the server software (NCSA httpd was my choice) was freely available,
but my novice UNIX skills had been barely sufficient to get an anonymous FTP site
started and building and running the httpd software turned out to be completely beyond
my capabilities. I didn’t have the time to spend improving my skills and I couldn’t
justify the funds to hire someone who could do the job. It looked as if I was to be denied
my part in the fastest growing service on the Internet.
Luckily for me, there was a solution in the form of MacHTTP, a software package
from BIAP Systems in Houston, Texas. MacHTTP is a high-performance,
feature-packed WWW server that runs right on your own Macintosh under the
standard Macintosh OS. In this article I will show you how to install MacHTTP, how to
fine tune its performance, and how to use some of its special features. I will also talk
about why anyone would want to run a server in the first place and some issues to
consider in site design and maintenance.
In order to keep everyone on the same page, there is some terminology everyone
should know. If you aren’t completely familiar with terms like WWW, URL, FTP, and
HTTP, you should read the sidebar entitled “Vocabulary 301”. They will keep popping
up throughout this article and I’m not going to take time to explain them.
Before We Begin
Before we discuss how to start your own World Wide Web server we need to cover
some other topics.
Vocabulary 301
Here are some terms you need to know to when trying to set up a World Wide Web site
(or read this article).
FTP - File Transfer Protocol. A very common and basic method of providing files
for sharing with others.
Gopher - A more efficient type of FTP which allows more users to connect at once.
Also provides a way for one Gopher server to provide links to other Gopher
servers.
HTTP - HyperText Transfer Protocol A way of communicating that is based on
HyperText files which contain links to other files.
NNTP - Network News Transfer Protocol. A way of transferring news messages
around on the Internet.
SMTP - Simple Mail Transfer Protocol. A way of transferring mail around on the
Internet.
Telnet - One of the earliest network services available. It allows you to connect to a
remote computer and issue commands as if you were physically at that computer.
URL - Uniform Resource Locator. A way of specifying exactly where a file is on the
internet and how to connect to it.
WWW - World Wide Web. A virtual network of servers which includes HTTP, FTP,
Gopher, and other servers connected by URL’s.
Why Run a Server
The first topic is, “Why do you want to start your own server?” I warn you
right now that a World Wide Web server is a time sink that will gradually steal away
more and more of your working day until you have time for nothing else but building
your site. This is not because maintenance is so difficult. In fact, maintenance is an
almost negligible task for most sites (but don’t tell your boss that). The truth is that
there are so many cool things you can do with a Web site that its hard to resist adding
just one more hack and each hack takes a little bit longer than the last. So, if you plan
to run a site, make sure you have the willpower to resist this temptation (or have a
very secure job).
Now that I am legally covered, we can discuss how you could benefit from running
a World Wide Web server. Here is a list of good reasons that I keep handy:
• To advertise products or services for your company or yourself
• To attract potential customers for your company, organization, or non-profit
group
• To publish research results
• To provide online help resources for customers
• To publish informational articles, newsletters, magazines, or anything else
• To provide an easier front-end to existing network services like FTP or Gopher
sites
• To provide easy access to databases of all kinds
• To conduct surveys or gather opinions or comments on any topic
• To make personal information like your photo, resume, or opinions available to
the general public.
• To put up pictures of your last vacation or your pet dog (cats are acceptable as
well).
As you can see, there are a number of ways that a World Wide Web site can be useful.
Is putting up a WWW site a good idea for you or your company? If your company
already offers services on the Internet (mailing lists, FTP sites, WAIS databases),
then the decision is fairly easy. A WWW server can provide a much nicer interface to
all of these and even help unify multiple services for your customers. However, if
this is your first foray into Internet services you need to give this some thought.
Think of the kind of people that inhabit the Internet. Now think of your product or
service. Do they want it? If not, then this probably isn’t for you. But don’t let that
stop you...
Uniform Resource Locators
The next topic to cover is Uniform Resource Locators or URL’s. URL’s are text
strings that completely specify where a file or directory can be found on the Internet
or a local computer. They form the connective filaments of the World Wide Web,
connecting servers which run a variety of protocols from HTTP to Telnet.
A URL uses the following format:
protocol://server_address[:server_port]/[directory/][filename]
protocol can be any of http, ftp, gopher, telnet, nntp, mailto, or any other
communications protocol that works on the network. This tells the client software how
to communicate with the server. It is up to the client software to support the protocol,
as in “mailto”, which is not supported by all clients.
server_address is either the IP address or DNS name of the server which has the
file.
server_port is an optional number which designates what port the server
communicates on. We’ll talk more about that later, but if nothing is specified, the
standard port of 80 is used by default.
/ indicates the root directory for the site. Only files in this directory tree can be
accessed.
directory/ is a sub-directory or directory path that contains the file.
“files/reports/daily/”, for example.
filename is an optional string telling which file should be returned. If no
filename is specified, then a default action is done for the folder. In some cases
(depending on the server) a listing of the directory is returned. This is not very safe,
as it gives clients access to every single file on your site. MacHTTP uses a different
method that will be discussed below.
In summary, the URL specifies what method to use to connect to the server, what
server to connect to, what directory to look in, and what file to return in that
directory. Since all of this information is provided in the link, the user doesn’t need to
know anything about such things and can click on any link without worrying about
where it leads. This is a simplification, of course. More information about URL’s can
be found at http://www.w3.org/hypertext/WWW/Addressing/Addressing.html
Choosing a Server
The final topic to cover is that of selecting the proper server. If you have to deal
with UNIX-loving network administrators, then you will need rational reasons for
selecting a Macintosh as your server. Use the following guidelines to help you make
your decision.
Performance - I’ll talk more about this later, but suffice it to say here that a
Macintosh server running MacHTTP will outperform an equivalently priced UNIX
workstation running either the NCSA or CERN servers.
Installation - This is the real Macintosh strength. Even a fairly inexperienced
Macintosh user can get MacHTTP running in very little time. On the other hand, even a
very experienced UNIX person may have some problems installing the NCSA or CERN
servers. This stems primarily from the fact that MacHTTP comes as a fat binary
which is ready to run on any Macintosh, while the NCSA and CERN servers need to be
compiled and there is a tremendous variety across the platforms they support.
Server Maintenance - MacHTTP 3.0 can be completely monitored and
controlled remotely with an easy-to-understand graphic client. I have yet to see
another server that offers this ease of maintenance.
Server Stability - Don’t believe the rumors that Macintoshes crash more
than other systems. If you have a lot of freeware system extensions installed (as I do)
then that might be true. Without those extensions, though, your Macintosh will keep
running for months or even years without crashing.
OS Design - Another vicious rumor says that the Macintosh can’t be a server
because it doesn’t have pre-emptive multi-tasking. Actually, this is not necessary
because the server software itself provides the multi-tasking using the Thread
Manager.
Site Content Maintenance - If the people who will be adding content to the
site are also Macintosh users, then this is a major consideration. By running a
Macintosh server, they can mount the files directly on their computers for easy
editing.
Starting A Site
So now you’re ready to begin. There are really only three things you need to start your
WWW site: a Macintosh computer, the MacHTTP software, and network connection (not
strictly required). The Macintosh must be running MacOS System 7.1 or later, but
any Macintosh from a Plus on up can be a server. Either MacTCP or OpenTransport (if
it is released by the time this is printed) are needed for network connectivity and a
minimum of 600K of free memory is required to run MacHTTP. If you want people to
be able to reach your server, you need a dedicated connection to the Internet and an IP
address. The documentation that comes with MacHTTP includes instructions for
running on a standalone machine, though, if you need to do so for demonstration or
development purposes.
See the end of the article for details on where to get the software.
Installation
The MacHTTP software distribution comes with a complete WWW site in a server
folder that you can copy onto your hard disk. It doesn’t matter where on your disk you
copy it or what name you give the folder. This is because once you launch MacHTTP,
whatever folder it is in becomes the root of your WWW site. The URL’s you use on the
site will all use paths relative to this root so it doesn’t matter to them whether your
server folder is at the root of the hard disk or buried 10 folders deep.
MacHTTP is preconfigured with settings that are appropriate for the majority of
sites. This means that installation amounts to four steps:
1) Copy the server folder over to your hard disk.
2) Give the folder a name that you like.
3) Open the server folder
4) Double-click on MacHTTP
Congratulations! You now have a fully-functional site. That’s all there is to it.
You can access your new server from your favorite WWW client by using the following
URL: “http://your_ip_address/” where “your_ip_address” is the IP address the
machine you are running MacHTTP on (e.g., 129.45.3.100).
About MacHTTP
Now that you have MacHTTP running, it is probably time to learn a little more about
it. MacHTTP is the product of Chuck Shotton of BIAP Systems, Inc. It was the first
HTTP server available for the Macintosh and now offers all of the features you expect
of professional HTTP server software including:
• multiple, threaded connections *
• HTTP 1.0 support (also an HTTP 0.9 compatibility mode)
• CGI application support
• site- and document-based security
• secure connections
• remote site monitoring and administration
• gateway for credit card payments (First Virtual)
• support for database and text-searching systems (WAIS, AppleSearch, Verity)
* MacTCP limits to 48 connections
due Q2 1995
MacHTTP also offers several special features that make it easier to use than other
servers, especially in a Macintosh-based installation:
CGI (Common Gateway Interface)
The Common Gateway Interface is a proposed standard for information services to
communicate with external applications. So far, only HTTP servers take advantage of
this standard, and MacHTTP follows the latest CGI standards. The advantage lies in the