Printing Clients and Servers

2009-05-13 02:34:06来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

by
Michael W. Lucas
02/05/2004
Last time, we
configured two commodity home printers to work with a FreeBSD system
. Now we'll learn how to use FreeBSD's built-in tools to configure this system as a print server for other UNIX boxes and how to configure client machines to use this server. While there are many add-on programs that claim to make client printing easier, I find lpd(8) and its friends very quick and easy.
The Server
Start by making the printer work on the system you want to be the server. While the lpd(8) daemon that gets print jobs to the printer listens to the network by default, it doesn't accept print requests from just anyone. You must list the hostnames or IP addresses of permitted clients in /etc/hosts.lpd, each on a single line. I recommend using IP addresses so that a DNS failure won't take printing with it.
The Client
Printer client configuration is identical for any server that runs lpd(8). This means that your FreeBSD client can use any print server from the integrated lpd(8), add-on programs such as LPRng, or even Microsoft's Print Services for UNIX, without changing your client configuration. Here's a typical /etc/printcap configuration for a printing client.
lp|networkdept:\
        :lp=:\
        :rp=networkdept:\
        :rm=print:\
        :sd=/var/spool/output/lpd/networkdept:\
        :lf=/var/log/lpd-errs:
Just like termcap(5), each printer entry is technically a single line. The backslash character indicates that an entry continues on the next line. Also, each configuration option begins and ends with colons.
The first line is the printer name. This client has two names for this printer, lp and networkdept. lp is the standard UNIX name for the default printer, but I added networkdept as a friendly reminder. A printer can have any number of names — separate them with the pipe character, as shown above.
The second line, lp, lists the device name for this printer. As we're configuring a client for a network printer, leave the device name empty.
The third line, rp, gives the name that the print server uses for the printer in question. The print server's /etc/printcap lists the printer outside my office as networkdept, so that's the printer name I use.
The rm entry gives the hostname of the print server, in this case print. If your print server is in a different domain, use a fully qualified domain name here.
The fourth line, sd, lists the spool directory used for this printer. Every printer in your /etc/printcap needs a unique spool directory, which you must create before trying to use the printer.
Finally, the lf entry gives the full path to the log file. Unlike the spool directory, printers can share a log file.
Once you have configured a printer, fire up the printer daemon on your client. It doesn't matter if your printer is attached to the local machine or elsewhere on the network, the system still needs a daemon to send print jobs to the printer. You can now hit Print in your application and it should "just work."

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Unix Printing Basics

下一篇:ob3.8---webmail