Thursday, April 28, 2016

setup yoru own gopher server

Gopher is a protocol that is designed for distributing, searching, or retrieving documents on the Internet. And it is an alternative to the World Wide Web (http protocol) in its early age. but http wins over gopher. but still it remains survive till these days, even now it shares very bit of portion of internet traffic.

1- install gopher using package name pygopherd
$ sudo apt-get install pygopherd

2- the configuration of gopher is straightforward  by editing file  /etc/pygopherd/pygopherd.conf as below, you will get document root of gopher point to /var/gopher/ where you can place your file and let other people to download it.

[pygopherd]
detach = yes
pidfile = /var/run/pygopherd.pid
port = 70
servertype = ForkingTCPServer
timeout = 60
abstract_headers = on
abstract_entries = always
tracebacks = yes
usechroot = yes
setuid = gopher
setgid = gopher
root = /var/gopher
mimetypes = ./conf/mime.types:/etc/pygopherd/mime.types:/etc/mime.types
encoding = mimetypes.encodings_map.items() + \
          {'.bz2' : 'bzip2',
           '.tal': 'tal.TALFileHandler'
          }.items()
[logger]
logmethod = syslog
priority = LOG_INFO
facility = LOG_LOCAL3
[GopherEntry]
defaultmimetype = text/plain
mapping = [['text/html', 'h'],
        ['text/.+', '0'],
        ['application/mac-binhex40', '4'],
        ['audio/.+', 's'],
        ['image/gif', 'g'],
        ['image/.+', 'I'],
    ['application/gopher-menu', '1'],
    ['application/gopher\+-menu', '1'],
        ['multipart/mixed', 'M'],
        ['application/.+', '9'],
        ['.*', '0']
        ]
eaexts = {'.abstract' : 'ABSTRACT',
          '.keywords' : 'KEYWORDS',
          '.ask' : 'ASK',
          '.3d' : '3D'}
[handlers.HandlerMultiplexer]
handlers = [url.HTMLURLHandler, gophermap.BuckGophermapHandler,
            mbox.MaildirFolderHandler, mbox.MaildirMessageHandler,
            UMN.UMNDirHandler, html.HTMLFileTitleHandler,
            mbox.MBoxMessageHandler, mbox.MBoxFolderHandler,
            file.FileHandler]
[handlers.file.CompressedFileHandler]
decompressors = {}
decompresspatt = .*
          
[handlers.dir.DirHandler]
ignorepatt = /.cap$|/lost\+found$|/lib$|/bin$|/etc$|/dev$|~$|/\.cache|/\.forward$|/\.message$|/\.hushlogin$|/\.kermrc$|/\.notar$|/\.where$|/veronica.ctl$|/robots.txt$|/nohup.out$|/gophermap$|\.abstract$|\.keyboards$|\.ask|\.3d$|~$
cachetime = 180
cachefile = .cache.pygopherd.dir
[handlers.UMN.UMNDirHandler]
extstrip = nonencoded
[handlers.ZIP.ZIPHandler]
enabled = false
pattern = \.zip$
[protocols.ProtocolMultiplexer]
protocols = [wap.WAPProtocol, http.HTTPProtocol,
             gopherp.GopherPlusProtocol, rfc1436.GopherProtocol]
[protocols.gopherp.GopherPlusProtocol]
admin = Unconfigured Pygopherd Admin <pygopherd@nowhere.nowhere>
[protocols.http.HTTPProtocol]
iconmapping = {'h' : 'text.gif',
            '0' : 'text.gif',
            '4' : 'binhex.gif',
            's' : 'sound1.gif',
            'g' : 'image3.gif',
            'I' : 'image3.gif',
            'M' : 'text.gif',
            '9' : 'binary.gif',
            '1' : 'folder.gif',
            '7' : 'folder.gif',
            'i' : 'blank.gif'}
pagetopper = Welcome to Gopherspace!  You are browsing Gopher through
   a Web interface right now.  You can use most browsers or Gopher
   clients to browse Gopher natively.  If your browser supports it,
   <A HREF="GOPHERURL">try clicking here</A> to see this page
   in Gopher directly.  To find Gopher browsers,
   <A HREF="http://quux.org:70/Software/Gopher/Downloads/Clients">click
   here</A>.<HR>
[protocols.wap.WAPProtocol]
waptop = /wap



3- restart gopher service, by execute the following command
$ sudo /etc/init.d/pygopherd restart

4- create a text document in /var/gopher/ so that someone know the name, they can download it
$ echo this is test file /var/gopher/test

*** client part ***
in this, i show you 3 ways to access gopher sites, 1- command line (gopher) 2- firefox addons, you can access gopher directly from firefox web browser 3- gopher proxy
----gopher command---
1- install gopher, by default your system does not install it, probably.
$ sudo apt-get install gopher

2- to access the site just your command gopher and the ip/name of gopher site
$ gopher 192.168.202.25




---firefox addons---
1- install this firefox addons,OverbiteFF ,then you will all to access gopher protocol from firefox browser (gopher:// similar to http://), below is the link to install the addons
https://addons.mozilla.org/en-US/firefox/addon/overbiteff/

2- to access gopher use the following url replace 192.168.202.25 with your server ip address that you install pygopherd
gopher://192.168.202.25
or access to the test file we have created
gopher://192.168.202.25/test

3- there are public gopher servers, like below, so you don't have to install anything, this site will convert back, forth from http to gopher, or vice versa
https://gopherproxy.meulie.net/

***note***
search engines also exist on gopher such as gopher://gopher.floodgap.com/ so if you can not find what you want on http sphere,  just try in the gopher sphere.




1 comment:

  1. I didn’t know about the gopher server before i read your post. it seems helpful for when you don’t wish to search your queries on the worldwide web.

    ReplyDelete