Linux Unleashed, Third Edition:Setting up a Gopher Service
-->
Previous
Table of Contents
Next
The plus signs used in the Port and Host fields instruct the FTP service on the remote machine to return results to this machine using default ports (such as TCP port 21 for FTP). For a link to a WAIS directory, the format is:
Name=More Sales Info
Type=7
Port=+
Path=waisrc:/usr/wais/data
Host=+
Finally, you may want to have a menu item execute a program. You can do this by having the Path field use the exec command:
Path=exec: args : do_this
where do_this is the program you want to execute and args are any arguments to be passed to do_this. If you have no arguments to pass, leave the quotation marks empty. This format is a little awkward, but it does work.
Starting Gopher
A Gopher server can be started either from the rc startup files, from the command line, or from the inetd daemon. From the command line or the rc files, you need a command line similar to this:
/usr/local/etc/gopherd /usr/gopher/gopher-data 70
which starts the daemon with the directory the startup Gopher menus reside in and the port number for connections.
The gopherd command line accepts a number of optional flags to control its behavior, although most mirror entries in the configuration files. Valid flags are as follows:
-C
Disables directory caching.
-c
Runs without chroot restrictions.
-D
Enables debugging.
-I
inetd is used to invoke gopherd.
-L
Followed by a value for the maximum load average.
-l
Log file to record connections (filename follows the option).
-o
Specifies an alternate configuration file from gopherd.conf (filename follows the option).
-u
Sets the name of the owner running gopherd (valid username must follow the option).
To help secure your system, use chroot to create a separate file system structure for the Gopher area (as you did with FTP: see Chapter 48, Setting up an FTP and Anonymous FTP Site). The -c option is not as secure as running gopherd with chroot active. Also, the -u option should be used to make gopherd run as a standard users process, instead of as root. This helps protect against holes in the daemon that a hacker could exploit.
If you want to run Gopher under inetd (started whenever a request for the service arrives), modify the /etc/services and /etc/inetd.conf file to include a line for Gopher. Normally, the entry in /etc/services looks like this:
gopher 70/tcp
and the entry in /etc/inetd.conf looks like this:
gopher stream tcp nowait root
/usr/local/etc/gopherd gopherd -I -u username
where username is the name of the user to run gopherd as (you can set up a specific account for gopher in /etc/passwd with standard permissions).
Once the Gopher server process is up and running, you can test your Gopher installation. First, though, you will need a Gopher client. Then use the Gopher client to connect to your Gopher server (using your host name), and you should see the top directory of your Gopher resources. Another way to test your Gopher system is to use Telnet. Use Telnet to connect to the Gopher port, using a command like this:
telnet gopher 70
If the connection is properly made, you will see your Gopher system on the screen.
Yet another alternative to test your system is to use the program gopherls, which requires the name of the directory your Gopher source resides in. To start gopherls, issue a command as follows:
gopherls /usr/wais/gopher/data
specifying your Gopher data directory. You can use this technique to test new Gopher directories as you develop them.
Letting the World Know
Because you have spent a lot of time setting up your Gopher service, you can now let everyone else on the Internet know about it. (Of course, you should only do this when your Gopher service is ready, and if you want to allow general access. Dont follow these steps if you are granting access only to a few people or your local area network.)
To have your Gopher service listed in the main Gopher service directories, send an email message to the address:
gopher@boombox.micro.umn.edu
and include the Gopher services full name as it appears on your main menu, your hosts name and IP address, the port number Gopher uses (which should be TCP port 70 for general Internet access), the email account of the Gopher administrator, and a short paragraph describing your service. If you want, you can also provide a string that gives the path to the data directory, although since most Gopher systems start in the root directory, this string isnt necessary unless you have sub-menus for different purposes.
Summary
After all that, your Gopher service is ready to use. You do need to set up the Gopher file entries, but that is beyond the scope of this chapter. Consult a good Internet or Gopher book for more information on Gopher directories, files, and entries. Gopher is a handy utility if you have volumes of information you want to share, and although the configuration process can take a while, once its completed, the Gopher system tends to work very well. To learn more about:
How to set up a World Wide Web server on your Linux machine, see Chapter 51, Configuring a WWW Site.
How to program in HTML to set up your home pages for the Web, see Chapter 53, HTML Programming Basics.
How to use Java to provide more flexibility to your home pages, see Chapter 54, Java and JavaScript Basics.
make and the makefile utility, see Chapter 56, Source Code Control.
Previous
Table of Contents
Next
Wyszukiwarka
Podobne podstrony:
826 829demo cgi 829829 (2)mbdch20 8322009 10 13 Wstęp do SI [w]id&832832 (2)mbdch20 829więcej podobnych podstron