Compiling and installing Gophernicus

Gophernicus requires a C compiler but no extra libraries aside from standard LIBC ones. 
Care has been taken to use only standard POSIX syscalls so that it should work pretty 
much on any *nix system.

Please make sure that you checkout to the correct version you want. Currently, you most 
likely want version 3.1.1.

To compile and install run:

$ git clone -b 3.1.1 https://github.com/gophernicus/gophernicus.git
$ cd gophernicus
$ ./configure --listener=somelistener
$ make
$ sudo make install

Important configure arguments include:

--listener. This is the only required argument. You must choose a listener that passes network 
requests to gophernicus, as gophernicus dosen't do this by itself. The options are:systemd, a 
common init system on many Linux distributions that can do this without an external program.
inetd, an older, well-known implementation that is very simple.xinetd, a modern reimplementation 
of inetd using specific config files.mac, to be used on Mac OSX machines.haiku, to be used on 
Haiku machines.autodetect, which looks at what you have avaliable (unrecommended, please manually 
specify where possible).

 
NB. As im using Ubuntu i have choose to use xinetd.I think i was preinstalled in my system. 
There is a bit of a configuration for it too which i will add after this section.

--hostname. This is by default attempted to be autodetected by the configure script, using the 
command hostname. It is expected to be the publicly-accessible address of the server. However, 
this might be completely wrong, especially on your personal machine at home or on some cheap VPS. 
If you know you have a fixed numerical IP, you can also directly use that. For testing, just keep 
the default value of localhost which will result in selectors working only when you're connecting locally.


--gopherroot. The location in which your gopher server will serve from. By default is /var/gopher. 
Also can be changed later using the -r <root> parameter in configuration files.

so the $ ./configure command becomes 
$./configure --listener=xinetd --hostname=yourhostname --gopherroot=gopher-files-root

Now you need to add few line or check if this lines are already added to xinetd.

open the following file with a text editor.

$vi /etc/xinetd.d/gophernicus

make show the file has the following lines 

service gophernicus
{
        socket_type     = stream
        wait            = no
        user            = nobody
        server          = /usr/local/sbin/gophernicus
        server_args     = -r /var/gopher -h nestederror.cf -p 70
}

now restart xidentd
$sudo systemctl restart xidentd


Read up the gophermap section to learn about gopherspace.

if everything gone as planned now you are ready to visit your gopherspace by typing 
   
    lynx gopher://yourhostname


now you ready to Rock the gopher world. please keep it in mind gopher dont work in regular browsers. 
Some of the regular browser have extentions for gopher space. We will add a gopher to http bridge which 
will allow you to access you gopherspace via httpd.


Pre-installation Command line options

-h hostname   Change server hostname (FQDN)      [$HOSTNAME]
-p port       Change server port                 [70]
-T port       Change TLS/SSL port                [0 = disabled]
-r root       Change gopher root                 [/var/gopher]
-t type       Change default gopher filetype     [0]
-g mapfile    Change gophermap file              [gophermap]
-a tagfile    Change gophertag file              [gophertag]
-c cgidir     Change CGI script directory        [/cgi-bin/]
-u userdir    Change users personal gopherspace  [public_gopher]
-l logfile    Log to Apache-compatible combined format logfile

-w width      Change default page width          [67]
-o charset    Change default output charset      [UTF-8]

-s seconds    Session timeout in seconds         [1800]
-i hits       Maximum hits until throttling      [4096]
-k kbytes     Maximum transfer until throttling  [4194304]

-f filterdir  Specify directory for output filters
-e ext=type   Map file extension to gopher filetype
-R old=new    Rewrite the beginning of a selector

-D text|file  Set or load server description for caps.txt
-L text|file  Set or load server location for caps.txt
-A admin      Set admin email for caps.txt

-U paths      Specify a colon-separated list of extra unveil(2) paths
              (OpenBSD only).

-nv           Disable virtual hosting
-nl           Disable parent directory links
-nh           Disable menu header (title)
-nf           Disable menu footer
-nd           Disable dates and filesizes in menus
-nc           Disable file content detection
-no           Disable charset conversion for output
-nq           Disable HTTP-style query strings (?query)
-ns           Disable logging to syslog
-na           Disable autogenerated caps.txt
-nt           Disable /server-status
-nm           Disable shared memory use (for debugging)
-nr           Disable root user checking (for debugging)
-np           Disable HAproxy proxy protocol
-nx           Disable execution of gophermaps and scripts
-nu           Disable personal gopherspaces

-d            Debug output in syslog and /server-status
-v            Display version number and build date
-b            Display the BSD license
-?            Display this help