FreeBSD 6 Unleashed
CUPS (Common UNIX Printing System) is an alternative to the venerable lpr subsystem presented earlier in this chapter, and is intended to be a cross-platform printing solution for all UNIX environments. CUPS is not a standard part of FreeBSD, nor is it included in a standard FreeBSD installation. It is, however, available in the FreeBSD ports collection, and its home page (where a great deal of useful information can be found) is at http://www.cups.org. The strength of CUPS is that it's geared toward printing in the same paradigm as in the Windows world, where printers are described to the operating system using PPD (PostScript Printer Description) files that can be distributed over the network transparently to the user, and where print jobs are transmitted using the industry-standard Internet Printing Protocol (IPP). Many UNIX-style operating systems, including Mac OS X and many distributions of Linux, have already made CUPS their standard printing mechanisms. Install CUPS from the ports or packages in the print category (see Chapter 16 for more information on installing ports or packages). When CUPS is installed, you need to go into /usr/local/etc/rc.d and rename cups.sh.sample to cups.sh, and then start the daemon using the ./cups.sh start command. There is a complete set of command-line tools for adding printers and managing queues included in CUPS; but there's also a web interface that you can use to manage your printing needs graphically, as shown in Figure 17.4. Figure 17.4. The web interface of CUPS.
In its default configuration, the CUPS web interface can only be accessed from the local system using a browser in X11; access the URL http://localhost:631 to enter the system. When you're prompted for user authentication information, use the system's root username and password. You can then use the buttons in the page to set up printers using sequential "wizard" screens to pick drivers and specify printer behaviors. You'll then be able to send your command-line and KDE print jobs to the much more versatile CUPS subsystem instead of lpr, and monitor them using the same web interface. If you need to download new drivers for your specific printer model, it's much easier to do so in CUPS than in lprvisit the http://www.cups.org site to look up commercially supported drivers and instructions on how to add them to the system. Because CUPS is the underlying printing technology in Mac OS X and most Linux distributions, the bulk of modern printer drivers are written for CUPS rather than lpr, so try CUPS if your printer isn't supported by FreeBSD's standard printing system. Caution It's possible to change the configuration of the CUPS web interface so that remote administration is possible. However, be aware that if you do so, you're making it possible for remote users to access a web server on your FreeBSD machine that's running with root privileges, a prospect that ought to fill you with dread. If all is working properly, and your root password is secure, there's theoretically no problem; but should a buffer overflow in the web server be discovered, it becomes a simple matter for a remote user to exploit it to attack your system. Also there is no encryption built in, so you'd be transmitting your root password in clear text every time you access the CUPS system. You shouldn't enable remote web administration for CUPS unless it's absolutely necessary. A full discussion of CUPS and all its capabilities is beyond the scope of this book, but you can find a complete set of documentation at http://www.cups.org/doc-1.1/sam.html. |
Категории