Installing the Software 1. Get the file gn.tar.gz (or gn-2.*.tar.gz) and uncompress it and untar it to make the _gn_ source directory hierarchy. This file is available via anonymous ftp to ftp.acns.nwu.edu in the directory /pub/gn. The top level of the directory created by untarring this file contains four directories: gn, mkcache, waisgn and docs. 2. Edit the file "config.h" in the top level directory. You should enter the host name of the computer on which you plan to run _gn_ and the complete path name of your gopher data directory. If you want to run at a port other than 70 also edit the DEFAULTPORT entry. You should also specify the complete path of the file mkcache/gn_mime.types on your system. You can put this file anywhere convenient (and give it any name). This file is used by the mkcache program; see the section below on Content-type for an explanation of the function of this file. Other customizations are possible but should not be needed. 3. Edit the file "Makefile" in the top level directory. This allows you to specify the C compiler used if you wish to use something other than cc, e.g. gcc. You can also specify two directories in which things are placed when you do a "make install". The first of these SERVBINDIR is the path of the directory in which you want the executable file for the gn server installed. The second BINDIR is the location for the mkcache program. If you are using a SysV version of UNIX you will need to uncomment the "-DSYSV" compiler directive also. 4. In the directory gn-2.* do a "make" to produce the server "_gn_" and the utility "mkcache". The utility mkcache produces "cache files" for use by the server (it is described below). The binary _gn_ is the server and can be installed anywhere you choose. The binary mkcache is a utility program for maintainers and should be installed somewhere in your path, e.g. /usr/local/bin. 5. You can now either run the server as a standalone daemon, the _sgn_ executable, or run under inetd, the _gn_ executable. We first describe the standalone version. Run this with the command sgn -p port [other options] /path/to/gnroot & where "port" is the number of the port on which you wish the server to run. If this is a non-privileged port (i.e. > 1024) then _sgn_ can be run as an ordinary user. However, for privileged ports like 70 or 80 you must run the command above as root. When _sgn_ starts up it will change its user id to the one set in the config.h file line where USERID is #defined. The other way to run the server is to use gn under inetd. There are surely variations on how this works from system to system so you may need to look at the man page for inetd.conf(5). Here's how it works under many systems, e.g. Suns: Edit the file /etc/services and create the line gn 70/tcp (or replace 70 by the port you wish to use). Then edit the file /etc/inetd.conf and insert the line gn stream tcp nowait nobody /full/path/for/gn gn After the last _gn_ you can have optional arguments to turn on logging or use a different data directory (see the man page gn.8). It is important to run _gn_ as "nobody" (the fifth field in the inetd.conf line above) or some other user with no access privileges. If you are using an inetd with without the capability to set UID on startup (e.g., Ultrix), you should define the group ID and user ID in config.h so that the program is not running as root (look for the #defines USERID and GROUPID and set the values appropriately). It should _never_ be necessary to run _gn_ as root and to do so would be a serious mistake for maintaining security. Every attempt has been made to make _gn_ as secure as possible, even if it is run as root, however, no program accessible to remote users on the internet can be assumed perfectly secure. After editing the inetd.conf and services files you should find the process id number of the inetd process and do the command "kill -HUP pocess_id#". This must be done as root. If you have never done this before, get someone who has to help you. .