Administering CUPS


A few years ago, folks finally noticed that Unix printing was getting a little old, and the original /etc/printcap-and-lpd-based system was being stretched to its limits by the new kinds of printers that were widely available.

Late in 1999, the OS-agnostic Internet Printing Protocol (IPP) was released. The first version of CUPS was also released in 1999 and quickly became the default print engine for Linux and other free operating systems.

To install CUPS (FreeBSD)

FreeBSD installs the traditional lp/lpd combination by default, but installing CUPS is easy, courtesy of the ports collection.

Warning: Installing CUPS will overwrite the existing lpd printer configuration.

1.

Log in as root, or use su to become root.

2.

cd /usr/ports/print/cups

Change to the CUPS directory in the ports tree.

3.

make install clean

Install CUPS, then clean up. During the installation, the "GNU Ghostscript driver configuration" dialog (Figure 7.1) is displayed.

Figure 7.1. GNU Ghostscript options encountered while installing CUPS on FreeBSD.


4.

Press Tab and then Enter in the dialog to go with the default settings, which build a large number of drivers for different printers and output formats.

The build continues and eventually finishes installing CUPS and its related software.

5.

cd /usr/local/etc/rc.d

Change to the rc.d directory for local software installations.

6.

mv cups.sh.sample cups.sh

The cups.sh.sample script created during the CUPS installation process works fine under FreeBSD, so we can just rename it.

7.

Using your favorite text editor, add this line anywhere in the /etc/rc.conf file:

 cups_enable="YES" 

This will automatically start the CUPS server when the machine restarts.

8.

/usr/local/etc/rc.d/cups.sh start

Start the CUPS server.

Tips

  • On Mac OS X, use the Print & Fax pane of System Preferences to manage your printers.

  • Fedora Core has a graphical interface for managing printers (Figure 7.2): Open the Applications menu at the top left of the screen, then choose System Settings > Printing.

    Figure 7.2. Fedora Core's graphical printer-management application.



To be sure CUPS is running

You can interact with the CUPS server through an HTTP connection on any of the supported platforms (Fedora, FreeBSD, and Mac OS X). In fact, this is how you'll be configuring it.

  • Using your favorite Web browser, visit port 631 on the server (use clocalhost for hostname if CUPS is running on the same machine):

    http://hostname:631/

    Your Web browser displays the Common UNIX Printing System page (Figure 7.3).

    Figure 7.3. The Common UNIX Printing System page, the CUPS portal.


To add a printer to CUPS

The Web interface integrated with CUPS provides you with an easy way to add and manage printers.

1.

Using your favorite Web browser, connect to the CUPS server:

http://hostname:631/

Your Web browser displays the Common UNIX Printing System page (Figure 7.3).

2.

On the CUPS main page, click the Printers button in the toolbar at the top.

Your Web browser displays the Printer page (Figure 7.4).

Figure 7.4. The Printer page lets you add and manage printers with CUPS.


3.

On the Printer page, click the Add Printer button.

Note: If your Web browser prompts you for authentication after clicking the Add Printer button, use root@hostname and the root password.

Your Web browser displays the Add New Printer page (Figure 7.5).

Figure 7.5. The CUPS Add New Printer page.


4.

Enter a name, the printer's location, and a description of the printer in the Name, Location, and Description fields, respectively, on the Add New Printer page.

5.

Click the Continue button.

Your Web browser displays the "Device for name" page (Figure 7.6).

Figure 7.6. Selecting a device for the new printer in the "Device for name" page (here the name is "papyrus").


6.

In the Device pop-up menu, select the device that this printer is connected to, such as a parallel port or USB port. The Device menu also lists several network options.

7.

Click the Continue button.

If you've selected a network device, your Web browser displays the "Device URI for name" page (Figure 7.7).

Figure 7.7. Entering a URI for a remote printer.


On the "Device URI for name" page, enter a URI (Universal Resource Identifier) that gives a path to the networked printer.

8.

Click the Continue button.

Your Web browser displays the "Model/Driver for name" page (Figure 7.8).

Figure 7.8. Selecting a printer make.


9.

Select a printer make from the Make list.

Click the Continue button.

Your Web browser displays the second screen of the "Model/Driver for name" page (Figure 7.9).

Figure 7.9. Selecting a printer model.


10.

Select a printer model from the Model list.

Click the Continue button.

CUPS finishes installing the printer and displays a success page (Figure 7.10).

Figure 7.10. Now we've successfully created a new printer with CUPS.


If we visit the Printer page (http://hostname:631/printers) again, it shows your new printer (Figure 7.11).

Figure 7.11. The populated Printer page.


Tips

  • CUPS supports a number of additional configuration options that aren't exposed through the Web interface. Your cupsd.conf file (located in /etc/cups on FedoraCore or /usr/local/etc/cups on FreeBSD) is filled with comments and can be edited with your favorite text editor. Remember to restart the CUPS service (cupsd) when you're done!

  • Fedora Core's "Printer configuration" tool (in the Applications menu choose System Settings > Printing) supports more printers natively than the CUPS interface for adding new printers by using additional filters from the Gimp-Print package.


To manage print jobs with CUPS

A Web interface for managing printers wouldn't be that helpful without a way of managing print jobs on those printers, and CUPS provides a nice one.

1.

Using your favorite Web browser, connect to your CUPS server:

http://hostname:631/

Your Web browser displays the Common UNIX Printing System page (Figure 7.3).

2.

On the CUPS main page, click the Jobs button in the toolbar at the top.

Your Web browser displays the Jobs page (Figure 7.12).

Figure 7.12. Viewing the CUPS Jobs page.


The Jobs page lists all of the currently active printing jobs, as well as the jobs waiting in the queue for their chance to become hard copy.

3.

To put a job on hold, click the "Hold job" button next to the job's entry on the Jobs page.

The print job will remain on hold until you release it by clicking the Release button.

4.

To cancel a job, click the "Cancel job" button next to the job's entry on the Jobs page.

Warning: There is no confirmation step; the job is deleted as soon as you click the "Cancel job" button!

5.

To see print jobs that have finished printing or been canceled, click the

Show Completed Jobs button at the bottom of the Jobs page.

Your Web browser displays the Jobs page showing completed jobs (Figure 7.13).

Figure 7.13. Viewing the CUPS Jobs page displaying completed jobs.


Tips

  • You can still use the lp command to send jobs to a CUPS printer from the command line.

  • Use the lpstat command to get a list of your submitted print jobs displayed in the order in which they'll be printed. Use the -p option to find out which files and printers are currently active. Use -o with -p to view your jobs plus information on the active file and printer.

  • Use the cancel or lprm command to cancel a print job. Pass the job ID (found with the lpstat command, or reported from lp when you sent the job for printing) as an argument to either command.




    Unix Advanced. Visual QuickPro Guide
    Unix Advanced: Visual QuickPro Guide
    ISBN: 0321205499
    EAN: 2147483647
    Year: 2003
    Pages: 116

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net