File: server.doc

package info (click to toggle)
gopher 2.3-2
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 2,364 kB
  • ctags: 2,030
  • sloc: ansic: 22,451; perl: 1,950; sh: 1,510; makefile: 397; asm: 1
file content (208 lines) | stat: -rw-r--r-- 7,660 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
------------ 
Note, this document is getting out of date.  The most
current information is in the gopherd man page
------------



		 Internet Gopher Server Documentation
		       University of Minnesota


I. Overview of the Internet Gopher Server.

The Internet Gopher is a distributed document delivery service.  It
allows a neophyte user to access various types of data residing on
multiple hosts in a seamless fashion.  This is accomplished by
presenting the user a hierarchical arrangement of documents and by
using a client-server communications model.  The Internet Gopher
Server accepts simple queries, and responds by sending the client a
document. 

The document types that are currently supported are:

	1. Generic Text Files.
	2. Directories/Links.
	3. CSO Phone Book Services.
	4. Full Text Indexes.

The document types that are experimental and subject to change.

	1. Digitized sounds.

Currently the Internet Gopher Server software supports Text Files,
Directories and Sounds.  Full text indices generated using NeXT
Digital Librarian and WAIS are supported.  A CSO implementation is
available from the University of Illinois on uxc.cso.uiuc.edu as
/pub/qi.tar.Z.


III. Setting Up Your Server.
----------------------------

Setting up a gopher server is similar to setting up an anonymous ftp
site.  The first step is to compile the server.  When that's done make
a directory to hold the data.  If you want, you can even use your
present anonymous ftp directory.  (The server masks out the usr/,
bin/, dev/, /tmp, and etc/ directories.  It also doesn't show core
files either :-O).  Once your data directory is set up you can start
the gopher server.

Normally you would do this as root, since gopherd does a chroot to the
gopher directory by default (like anonymous ftp).  Thus the only
information that is transmitted to the outside world is what's in the
gopher-data directory.  You can use the -c option to start the daemon.
In this case, gopher will not do a chroot.  Instead it uses secure
versions of file opening system calls.  This works quite well and
allows you to place sybolic links in your gopher data directory

So, say that your gopher data resides in a directory called
/home/gopher-data.  To start the gopher daemon you would type in the
following:

   mkdir /home/gopher-data
   /usr/local/etc/gopherd /home/gopher-data 70

To start it up without a chroot() you could do the following:

   mkdir /home/gopher-data
   /usr/local/etc/gopherd -c -u lindner /home/gopher-data  70

The gopher daemon forks off and will then start accepting connections.
You can easily test the server by using telnet to connect to the port
specified on the command line.  Once connected, type return.  A list
of things in the gopher-data directory should be returned.  For
instance let's say that the server was started on the machine
"gopher".  To test it you'd do the following: 

mudhoney[6:18pm]-=> telnet gopher 70
Trying 128.101.95.29 ...
Connected to gopher.micro.umn.edu.
Escape character is '^]'.

    0About Gopher   /.about gopher.micro.umn.edu    150
    7Search Micro Consultant        asd     joeboy.micro.umn.edu    156
    7Search everywhere      kdkdkd  ashpool.micro.umn.edu   158
    1Search parts of the gopher world       /Search parts of the gopher world      gopher.micro.umn.edu     150
    1Other information      /Other information      gopher.micro.umn.edu    150
    1UPI newswire   /UPI newswire   gopher.micro.umn.edu    150
    1Computer information   /Computer information   gopher.micro.umn.edu    150
    1Minnesota Daily newswire       /Minnesota Daily newswire       gopher.micro.umn.edu    150
    .
    Connection closed by foreign host.
    mudhoney[6:21pm]-=> 


Unless you want greasy grimy gopher guts on your computer you'll also
put something similar to the following in you rc.local or equivilant: 

if [ -f /usr/local/etc/gopherd ]; then
	/usr/local/etc/gopherd /home/mudhoney/gopher-data 70
fi


IV. Usage
---------

[Please refer to the new gopherd man page for usage information....]


V. Adding Data to the Gopher Server.
-------------------------------------

To make a gopher directory, just use "mkdir" to create a directory in
the gopher data directory.  For instance, say you had a bunch of Heavy
Metal Lyrics you wanted to put online, you would do the following: 

cd /home/mudhoney/gopher-data
mkdir "Heavy Metal Lyrics"
cd "Heavy Metal Lyrics"
mkdir Metallica

Okay, now you want to add some text files to your gopher database.  To
do this just create and/or copy your textfiles into the directories in
the gopher Server data directory.  Here's a quick example:

cd "/home/mudhoney/gopher-data/Heavy Metal Lyrics/Metallica"
cp ~/mop.txt "Master of Puppets"

You'll want to create your text files and directories with descriptive
names.  Poor folks with 14 character System V filesytems, or people
with ftp directories should look into the .cap functionality described
later.

Now here comes the tricky part, Links.  The ability to make links to
other hosts is how gopher distributes itself among multiple hosts.
There are two different ways to make a link.  The first and simplest
is to create a link file that contains the data needed by the server.
By default all files in the gopher data directory starting with a
period are taken to be link files.  A link file can contain multiple
links.  A define a link you need to put five lines in a link file that
define the needed characteristics for the document.  Here is an
example of a link.

Name=Cheese Ball Recipes
Type=1
Port=150
Path=1/Moo/Cheesy
Host=zippy.micro.umn.edu

The Name= line is what the user will see when cruising through the
database.  In this case the name is "Cheese Ball Recipes".  The
"Type=" defines what kind of document this object is.  The following
is a list of all the defined types:

0  -- Text File
1  -- Directory
2  -- CSO name server.
7  -- Full Text Index
8  -- Telnet Session
s  -- Sound

The "Path=" line contains the selector string that the client will use
to retrieve the actual document.  The port and host lines should
speak for themselves.

An easy way to retrieve this information is to use the UNIX gopher
client.  Find the thing you're interested in and type the '=' key.  A
properly formatted link file will then be displayed.

Another way to retrieve this information is to use telnet to get the
information.  For instance let's say you want to link the University
of Minnesota's Gopher Server to your gopher server.  Just telnet to
the port (like in the example above) and retrieve the information.
The server returns a list in the following format:

<character Object Type><TAB><Name><TAB><Path><TAB><Host><TAB><Port>

You need to keep the Object Type, Path, Host, and Port the same in the
link.  You can change the name of the document if you want.


The second method of creating a link is a bit harder, however it's
ideal for such things as sounds where the only change needed is the
object type.

Here's how you'd change the file /home/mudhoney/sounds/Moo into a
sound, and also change it's name: 

  cd /home/mudhoney/gopher-data/sounds/
  mkdir .cap
  cd .cap
  cat >Moo
  Type=s
  Name=Cow Sound
  ^D

The idea is that you create a directory called .cap in the same
directory as the document.  Then you create a file with the same name
in the hidden .cap directory with the lines that you want changed.
You only need to put in what needs to be changed.  The server will
supply defaults if it doesn't find out what it needs.  In the above
example for instance, the host would supply the Host, Port and Path
for the object.  The only thing that changed was the type and the
name.