Next revision | Previous revision |
gopher_site_setup_and_hosting_features [2021/03/11 19:57] – created peteyboy | gopher_site_setup_and_hosting_features [2024/09/04 07:23] (current) – "'' hc9 |
---|
====== Gopher ====== | ====== Gopher ====== |
| |
| |
What is Gopher? | What is Gopher? |
| |
//From: http://en.wikipedia.org/wiki/Gopher_(protocol)// | //From: <nowiki>http://en.wikipedia.org/wiki/Gopher_(protocol)</nowiki>// |
| |
> The Gopher protocol is a TCP/IP Application layer protocol designed for distributing, searching, and retrieving documents over the Internet [...]. The protocol offers some features not natively supported by the Web and imposes a much stronger hierarchy on information stored on it. | > The Gopher protocol is a TCP/IP Application layer protocol designed for distributing, searching, and retrieving documents over the Internet [...]. The protocol offers some features not natively supported by the Web and imposes a much stronger hierarchy on information stored on it. |
* http://gopher.floodgap.com/overbite/relevance.html | * http://gopher.floodgap.com/overbite/relevance.html |
| |
===== Creating your Gopherspace ===== | ===== Viewing Gopherspace ===== |
| |
| There are many ways to view gopherspace. Here are the easiest ways you can [[accessing web spaces#Gopher| view gopher pages from the SDF shell]] |
| |
| Additionally, you can issue the ''gopher'' command, either from the SDF shell or from within the ''mkgopher'' command prompt. This command can be also used to create your gopherspace as described below, and also includes a very basic browser to explore gopherspace. |
| |
| ===== Creating your own Gopherspace ===== |
| |
The command ''mkgopher'' can be used to create and manage your gopherspace. | The command ''mkgopher'' can be used to create, manage and view your gopherspace. |
| |
When you run ''mkgopher'', you will be given a command prompt. You can issue the HELP command here to get a list of the available commands: | When you run ''mkgopher'', you will be given a command prompt. You can issue the HELP command here to get a list of the available commands: |
The setup command will create a directory in your $HOME called gopher (This directory is a link to /ftp/pub/users/$USER/ ). On it, you can put all the files you want to be available in your Gopherspace. | The setup command will create a directory in your $HOME called gopher (This directory is a link to /ftp/pub/users/$USER/ ). On it, you can put all the files you want to be available in your Gopherspace. |
| |
Once you create your Gopherspace, the files you publish will be available at [[gopher://sdf.org:70/1/users/| gopher://sdf.org:70/1/users/$USER/ ]]\\ (note: currently, the directory listing at gopher://sdf.org:70/1/users/ doesn't appear to list all user directories. You may have to directly navigate to gopher://sdf.org:70/1/users/$USER/ in order to view your files. | Once you create your Gopherspace, the files you publish will be available at [[gopher://sdf.org:70/1/users/| gopher://sdf.org:70/1/users/$USER/ ]]\\ (:!: currently, the directory listing at gopher://sdf.org:70/1/users/ doesn't appear to list all user directories. You may have to directly navigate to gopher://sdf.org:70/1/users/$USER/ in order to view your files.) |
| |
===== Viewing Gopherspace ===== | ==== Viewing with mkgopher ==== |
| |
There are many ways to view gopherspace. The easiest for new users is one of the following: | |
| |
==== SDF Gopher Command ==== | |
| |
You can issue the gopher command, either from the SDF shell or from within the ''mkgopher'' command prompt. This gives a very basic browser to explore gopherspace. | |
| |
==== Use Lynx ==== | |
| |
[[http://lynx.invisible-island.net/|Lynx]] is the //text// web browser. \\ In addition to web browsing, Lynx is also capable of browsing gopherspace. \\ From the SDF shell, you can issue the command: | |
| |
$ lynx gopher://sdf.org/ | |
| |
and Lynx will start up at sdf.org's gopher root menu. | |
| |
==== Floodgap Gopher Proxy ==== | |
| |
Floodgap.com provides a public gopher proxy that you can view in your web browser at https://gopher.floodgap.com/gopher/gw. \\ For more information, see the proxy info page: https://gopher.floodgap.com/gopher/ | You can issue the gopher command, either from the SDF shell or from within the ''mkgopher'' command prompt. This gives a very basic browser to browse your site and also explore gopherspace. |
| |
===== Publishing Content ===== | ===== Publishing Content ===== |
| |
You can use mkgopher to publish documents, create directories, etc. You can also manage your Gopherspace manually. If you decide to do so, remember that the server will not display your content if it is not already visible to everyone. That is, files need to world-readable (chmod o+r $HOME/gopher/yourfile), directories need also to be world executable (chmod o+rx $HOME/gopher/yourdir), etc. **The gopher server ([[gopher://gophernicus.org/1/software/gophernicus/|Gophernicus]]) will serve executable files under /cgi-bin and also gophermaps which have executable permission as gopher CGIs or "moles" (see below). In the case of gophermaps, this is likely to result in errors, so make sure your gophermaps do not have execute permission (chmod -x $HOME/gopher/yourdir/gophermap).** | You can use mkgopher to publish documents, create directories, etc. You can also manage your Gopherspace manually. If you decide to do so, remember that the server will not display your content if it is not already visible to everyone. That is, files need to world-readable (chmod o+r $HOME/gopher/yourfile), directories need also to be world executable (chmod o+rx $HOME/gopher/yourdir), etc. **The gopher server ([[gopher://gophernicus.org/1/software/gophernicus/|Gophernicus]]) will serve executable files under /cgi-bin and also gophermaps which have executable permission as gopher CGIs or “moles” (see below). In the case of gophermaps, this is likely to result in errors, so make sure your gophermaps do not have execute permission (chmod -x $HOME/gopher/yourdir/gophermap).** |
| |
The usual 'mkgopher -p' command has not yet been updated to reflect Gophernicus' permissions requirements. So you may need to reset your permissions for all files and directories in your gopher directory as noted above. The following two commands will revert all files to world-readable but non-executable, and all directories to world-readable but executable. | The usual ‘mkgopher -p’ command has not yet been updated to reflect Gophernicus' permissions requirements. So you may need to reset your permissions for all files and directories in your gopher directory as noted above. The following two commands will revert all files to world-readable but non-executable, and all directories to world-readable but executable. |
| |
$ find ~/gopher/ -type f -print0 | xargs -0 chmod 644 | $ find ~/gopher/ -type f -print0 | xargs -0 chmod 644 |
| g | GIF image | | | g | GIF image | |
| h | HTML, Hypertext Markup Language | | | h | HTML, Hypertext Markup Language | |
| i | "inline" text type | | | i | “inline” text type | |
| s | Sound | | | s | Sound | |
| I | Image (other than GIF) | | | I | Image (other than GIF) | |
0Why is Gopher Still Relevant? /gopher/relevance.txt gopher.floodgap.com 70 | 0Why is Gopher Still Relevant? /gopher/relevance.txt gopher.floodgap.com 70 |
hAn http link URL:http://sdf.org/ | hAn http link URL:http://sdf.org/ |
| |
| |
Remember the gophermap syntax? Then be careful about tab characters. In the example above, there are some<TAB>s. For instance, the third line is | Remember the gophermap syntax? Then be careful about tab characters. In the example above, there are some<TAB>s. For instance, the third line is |
Say that you have two entries in your diary. If you use mkgopherentry, they will appear like: | Say that you have two entries in your diary. If you use mkgopherentry, they will appear like: |
| |
>--This is my second post!-- | <file config entries> |
> Tuesday, December 01th, 2009 | |
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. | |
> Cras eros turpis, tristique semper aliquet sit amet, | |
> hendrerit vel enim. Integer pulvinar leo in dolor posuere | |
> blandit. | |
> Continued... | |
> | |
> --First post-- | |
> Monday, November 30th, 2009 | |
> First entry in my gopher log at SDF. | |
> Continued... | |
| |
//NOTE:// You can use the 'phlog' command to add your phlog/glog to the gopher.club phlog listing, and you can then update the listing after you create a post by running the following command: "touch ~ftp/pub/users/$LOGNAME" | --This is my second post!-- |
| Tuesday, December 01th, 2009 |
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
| Cras eros turpis, tristique semper aliquet sit amet, |
| hendrerit vel enim. Integer pulvinar leo in dolor posuere |
| blandit. |
| Continued... |
| |
| --First post-- |
| Monday, November 30th, 2009 |
| First entry in my gopher log at SDF. |
| Continued... |
| |
| </file> |
| |
| //NOTE:// You can use the ‘phlog’ command to add your phlog/glog to the gopher.club phlog listing, and you can then update the listing after you create a post by running the following command: “touch ~ftp/pub/users/$LOGNAME” |
| |
==== Other glog/phlog software ==== | ==== Other glog/phlog software ==== |
==== Mole examples ==== | ==== Mole examples ==== |
| |
Remember that your moles need to be executable (and readable) by everyone, and under /cgi-bin. So you will have to do: "chmod 755 YOURSCRIPT.cgi" | Remember that your moles need to be executable (and readable) by everyone, and under /cgi-bin. So you will have to do: “chmod 755 YOURSCRIPT.cgi” |
| |
=== fortune.cgi === | === fortune.cgi === |
Easy enough, isn't it? As it is raw text, you can access it using am itemtype = 0, that is: gopher://sdf.org/0/users/YOUR-USERNAME/cgi-bin/fortune.cgi | Easy enough, isn't it? As it is raw text, you can access it using am itemtype = 0, that is: gopher://sdf.org/0/users/YOUR-USERNAME/cgi-bin/fortune.cgi |
| |
Did you notice that fortune was called with a full path? OK, that's because the server's path is PATH=/sbin:/bin:/usr/sbin:/usr/bin. That means that if you call a program without a path, the server will search in /sbin, /bin, /usr/sbin and /usr/bin. There's no /usr/pkg/games, or other path in the server's $PATH (eventually, you can add a path of your choice with, e.g., "PATH=$PATH:/usr/pkg/games"). | Did you notice that fortune was called with a full path? OK, that's because the server's path is PATH=/sbin:/bin:/usr/sbin:/usr/bin. That means that if you call a program without a path, the server will search in /sbin, /bin, /usr/sbin and /usr/bin. There's no /usr/pkg/games, or other path in the server's $PATH (eventually, you can add a path of your choice with, e.g., “PATH=$PATH:/usr/pkg/games”). |
| |
=== ls.cgi === | === ls.cgi === |
| |
The following example will generate a list of files on a specified directory. It will be possible to sort the content alphabetically or by modification time, based on how you access the script. | The following example will generate a list of files on a specified directory. It will be possible to sort the content alphabetically or by modification time, based on how you access the script. |
| |
| <code> |
| |
#!/bin/sh | #!/bin/sh |
done | done |
| |
Note that the echo... line is\\ " echo "$itemtype$content ($date)<TAB>$rel_dir<TAB>$server<TAB>$port" " | </code> |
| |
| Note that the echo… line is\\ “ ''echo "$itemtype$content ($date)<TAB>$rel_dir<TAB>$server<TAB>$port"'' ” |
| |
If you go to gopher://sdf.org/1/users/YOUR-USERNAME/cgi-bin/ls.cgi , you will see a list of your files sorted alphabetically. If you access your mole as gopher://sdf.org/1/users/YOUR-USERNAME/cgi-bin/ls.cgi?date , then you'll see your files/directories sorted by modification time. | If you go to gopher://sdf.org/1/users/YOUR-USERNAME/cgi-bin/ls.cgi , you will see a list of your files sorted alphabetically. If you access your mole as gopher://sdf.org/1/users/YOUR-USERNAME/cgi-bin/ls.cgi?date , then you'll see your files/directories sorted by modification time. |
==== Caveat ==== | ==== Caveat ==== |
| |
Besides what was said in the last paragraph of the figlet.cgi example, there's also another thing to stress. In that example (as with anything that will be served as a virtual directory or with an itemtype 1 or 7), content won't be displayed if you access your script via floodgap proxy (and maybe others). In this case you will need to format the output of your script. Luckily this is very easy. For instance, in the figlet.cgi example you will need to modify the echo ... line this way:\\ " echo "i$i<TAB><TAB>error.host<TAB>1" "\\ where <TAB> is a tab character (you should already know this!)C and error.host and 1 are, respectively, a fake server and port number (you could also have written fake instead of error.host and 300 instead of 1). | Besides what was said in the last paragraph of the figlet.cgi example, there's also another thing to stress. In that example (as with anything that will be served as a virtual directory or with an itemtype 1 or 7), content won't be displayed if you access your script via floodgap proxy (and maybe others). In this case you will need to format the output of your script. Luckily this is very easy. For instance, in the figlet.cgi example you will need to modify the echo ... line this way: |
| |
| ''echo "i$i<TAB><TAB>error.host<TAB>1"'' |
| |
| where <TAB> is a tab character (you should already know this!)C and error.host and 1 are, respectively, a fake server and port number (you could also have written fake instead of error.host and 300 instead of 1). |
| |
| ---- |
| |
| Traditional link (using [[wp>Revision_Control_System|RCS]]): http://sdf.org/?tutorials/gopher ,v 1.24 2020/01/01 22:37:47 niro Exp $ |
| |
--- | |
legacy link: http://sdf.org/?tutorials/gopher,v 1.24 2020/01/01 22:37:47 niro Exp $ | |