Gophermap How-To 
DeepGeek
March 2010

Abstract: In response to an email request, I came up with this how-to on setting up a Gopher 
site. 
1  Why Gopher

.Talk Geek To Me. episode number Hex 14 was dedicated to the

Gopher protocol. Shortly after that episode was released, I got email asking me for a how-to 
on setting up a Gopher site. 

However, before I get into it, I feel I need to make a few comments on Gopher.s relevance 
today. Some people think that talking about Gopher sites in 2010 is a joke. As part of my 
research on this How-to, I looked for info on setting up a blog via Gopher (called a phlog 
or glog in the slang.) What was google.s top page? A how-to on this topic, because it makes 
a fine April Fool.s day joke for you readership!

Gopher is relevant, but will it ever rival the web? Of course not. But the point is 
something I try to continually stress in these audiocasts. The right tool for the right job!

Should Apache be the only means of disseminating content on the interweb, .the right tool 
for the right job!. 

Should web-pages replace all the other means of communication in the world, .the right tool 
for the right job!.

Should texting replace telephones, .the right tool for the right job!.

Sorry for the repetition, but I gotta get the point across. We need tools to fit the tasks, 
we need to make technology work for us, instead of fitting into whatever technology is put 
upon us!

Do you advocate taking Gopher off the net?! I have an idea, let.s force all people who 
advocate such a thing to use Windows only for the rest of their lives, and see how they like 
using something that is not their choice. Or we can take those Windows users who want to 
force a choice upon others and compel them to use UNIX. Get the point?

Okay, rant mode off. Why Gopher? Gopher serves the information underground. Some of us need 
a .back channel,. on the Interweb. Not everybody can be .mainstream.. Usenet newsgroups used 
to serve this function, but the spammers killed that, leaving Usenet as a good way of 
transferring media files and not much else.

I had an interesting email back-and-forth with my net-friend Jason Scott of textfiles.com 
fame. He is considering putting some of his efforts into preserving information on the death 
of FTP. Now, I don.t consider FTP to be dead yet. I can name IRL friends who work with firms 
that have to toss big files around the interweb (like architectural plans) and graphical FTP 
clients are the way to go for such tasks. But OTOH, I had to transfer a video as a 
one-shot-deal to another friend who is actually a paid MS admin, and the only client he knew 
was Internet Explorer! So, FTP archives are a thing of the past, forget about the more 
mundane FSP and FXP completely. SSH rules untrusted file transfers now.

This was the email exchange I had with Jason Scott. He contended that my .MS Admin. case was 
typical, and that me and my friend, who works at the Architectural firm, were the .special 
cases.. He has a point, but so do I. I asked him about Gopher via email and he said, in so 
many words, that there is .enough of it being saved.. I guess one man.s .enough saved,. is 
another man.s .still alive..

So where does Gopher fit in? Gopher is an alternative to the FTP archive! In Gopherspace you 
set up a directory of pure content, and let your net-friends grab at it. Only your 
computer-geeky friends will go for this, and they have to use Lynx or Firefox with the 
Overbite extension. But if you want that platform, you can still have it. Why else? This 
protocol is designed to be handled by small computers, and will work with limited networks. 
No need for big dedicated server farms, you can do it yourself if you want. But that is not 
what this audiocast is about. This audiocast is about setting up the site. Let.s explore 
this now.
2  Structure

It is hard to get an email that says .please give us a how to on this.. And not just because 
my preference is to be conceptual in these audiocasts. I don.t want to force .my way. upon 
others, so I feel that getting the concepts out is good, and people who .get. those concepts 
can find their own way. But it looks like a how-to is needed here.

The other problem is to stick to answering the question. In the email I got, the analogy was 
made to writing HTML and CSS pages and using FTP to get them onto a server farm.s node. So 
this how-to assumes that you got an account on sdf.lonestar.org, a big traditional UNIX farm 
running Netbsd on DEC machines, and that you have validated it which will give you FTP 
access to your own directory. So, come to this with a shell account on sdf, AKA 
freeshell.org. Your FTP box will be ftp.freeshell.org and your shell box will be either 
otaku.freeshell.org or tty.freeshell.org or sdf.lonestar.org.

Another problem of .sticking to the question. is that the question can be interpreted in 
three ways. First, how to set up a site if your a total newb in regards to Gopher, second, 
how to set up a better looking site with some navigation functions similar to HTML.s page 
linking functions, and thirdly, how to set up a blog via gopher, because if your using 
Gopher to get text out, that is different than using it to make a download directory (which 
is the traditional function.)

I.m therefore going to give you these three ways of making a gopher site, and will give you 
them in order of difficulty. I.ll also stick to using the modern gophermap file to create 
links, as it is universal amongst modern gopher servers. There is another way with 
.dotfiles,. but I will leave this as an extra-credit exercise to the listener if they are 
that curious.
3  Setting Up Shop at Freeshell.org

First, what is involved in getting started with sdf.lonestar.org AKA freeshell.org? Well, go 
to their website. It is a free service and setting up is as easy as using a telnet applet 
over their web-page. You will want FTP, so you will have to validate your account. You can 
mail them a dollar, paypal them a fast five, or get a lifetime membership for $35. I took 
the later, because it gives you access to a faster shell server. You guys know me and my 
need for speed, right? 

Once you have followed the easy instructions and created an account, and then validate it by 
sending them some amount of money in some way, you are ready to start. SSH into your 
account, for me the command was ssh deepgeek @ @ otaku.freeshell.org. Thus, my username is 
deepgeek. When you are logged in, use the command .mkgopher. to set up your space. While 
there, do this command, .cd gopher,. then . pwd.. This will make their system tell you your 
gopher directories place in their file-servers file hierarchy, which you need to give to 
your FTP client of choice. Your gopherspace URL will be 
.gopher://sdf.lonestar.org/1/users/yourloginid.. Thus, my example site is at 
.gopher://sdf.lonestar.org/1/users/deepgeek..

Note the weird numeral .1. right after the .dot org.. URL.s in gopher are different in that 
they have an odd predefined type code in the first part after the machine.s name that tells 
your gopher browser what it is looking at. Thus, a directory like my "gopher home" directory 
starts with a .1. and a text file will start with a .0.. This, along with gopher working 
over port 70, will confuse non-gopher-ready web browsers, and if something is mal-formatted, 
check that first, as it is the most likely culprit for an ugly screen.
4  Easiest, .Plain Vanilla File Directory..

The easiest way of doing a Gopher site is to create a directory of files. Really, that.s all 
there is too it. Gopher is an answer to a question, .how can I have an FTP archive site 
without the hassle?. This is the actual .itch. Gopher was made to scratch. For those of you 
who may not remember FTP archives, heres a little explanation. A while ago, there where what 
was known as "FTP Archives". You would log in to these anonymously and be presented with a 
directory of files, from which you could download. Gopher supplied a twist on this paradigm, 
which was not to bother loging in, and being able to view directories, texts, and images, 
all on your favorite browser (sans the "images" part for textmode browsers.) If you point 
your gopher-enabled browser to gopher://sdf.org/1/users/deepgeek/no-gophermap You will see a 
directory with an image, an ogg, a text, a HTML file. If you click the image or text it will 
display, so will the HTML. The ogg should download.

Yes, I know it is hard to believe, but it can be that simple. 
5  Second Easiest, the Phlog

Okay, I know I started by showing you how to build a site by using the defaults to create a 
monolithic directory, but let.s ask .what do you mean by .a gopher site?.. You may mean "an 
interconnected series of pages", or you may want to have the Gopher version of a blog, which 
is called a phlog (with a ph) for some reason. This example will be, again, absurdly easy, 
but will rely on a little help from phlogging software. Instead of Ftping files in to your 
gopherspace, log in to your shell at freeshell.org. cd into your gopher directory and then 
mkdir a directory called phlog. Now, using your text editor of choice, begin making a few 
.txt files. These will be your phlog entries. Now, to really make it a phlog, we are going 
to use some software at freeshell.org. We will use mkgopherentry to create a good-looking 
gophermap file. So, from the directory you created your text files, run this command:
/sys/sdf/bin/mkgopherentry ..title.. textfile.txt 

Where .title. is the title of the entry, and textfile.txt, well, is the textfile you 
created. At this point, mkgopherentry will create or add an entry in a gophermap file to 
show the title, the first paragraph of the textfile, and a link called "continued..." that 
will take the user to the entry.

Again, it.s that easy. To see my example, see 
gopher://sdf.lonestar.org/1/users/deepgeek/phlog.
6  Building Your Own Gophermap File

Okay, now for the hard one, which really isn.t hard at all. Building your own gophermap 
file. Remember gopher://sdf.lonestar.org/1/users/deepgeek/no-gophermap? I have an identical 
directory in gopher://sdf.lonestar.org/1/users/deepgeek, only it has a gophermap I built 
myself. Now, when you check out this Gopher directory, you don.t see the gophermap file 
listed. But I did write the gophermap file to be a tutorial unto itself. Here is how to see 
the file. Remember when I talked about the number in the Gopher URL that told the browser 
what file type to expect? You change that number to a .0. and specify the gophermap file 
itself like this-gopher://sdf.lonestar.org/0/users/deepgeek/gophermap I would recommend that 
you open both in different tabs in Firefox. 

Building a gophermap file is easy. You can do it from your SSH session with your favorite 
editor. The file is basically a text file, and the lines you type are comments that get 
displayed. You can also add links right in the file.

Linking from within a gophermap file is easy, you start a new line but you use a special 
format for the link line, and this line is automatically detected by the server. The format 
is this:
XSome Text Here<tab>/path/to/content<tab>example.org<tab>N 

Where X is a code that describes the content linked to. .Some Text Here,. is the text you 
want to display as a link. A <tab>, and ./path/to/content.. If the file is in the same 
directory, you can just use the filename. If the content is on the same server, you don.t 
even need the .example.org,. (or in this case, .sdf.lonestar.org,.) because the server will 
make the right assumption. The last part, .N. is the port number. This is usually .70. for 
gopher service, again, leave it out for the right default.

Let.s take a real life example:
0Beef Oriental Recipe <Tab> /users/deepgeek/beef-oriental.txt<Tab>sdf.org<Tab>70 

Section by section, the line starts with a numeral zero, which says .this link will point to 
a text file. Then, without spaces or a tab, you see the phrase .Beef Oriental Recipe.. This 
phrase will be the highlighted and click-able link that will be displayed. Then a tab, then 
./users/deepgeek/beef-oriental.txt.. This is where on the server the file is. It starts with 
the root of the gopher data on the server, which you should not worry about as it is not 
your concern. But if you are curious, let.s say the system was set up to reside in a 
directory called ./var/gopher., then this really means .the text file located at 
/var/gopher/users/deepgeek/beef-oriental.txt.. Then a tab, then .sdf.org., which is the 
domain name in the Interweb where this is. Then a tab, and the number 70, which is the 
default port for gopher service.

The useful media descriptors are:
0 for text, 
1 for a directory, 
9 for a binary file, 
g for a gif image, 
I for another kind of image, 
h for html, 
s for sound. 

To create a link to an external web server, you would change ./path/to/content. with 
"URL:www.style-url.com/whatever.html."
7  Finishing up

This should be enough to start you playing. The only consideration that I can give is that 
you might have to break things down into many directories if you wanted to keep these pages 
short and simple. I hope this helps you start on your own Gopher site!