6.2. Common Unix Printing System (CUPS)

 < Day Day Up > 

The Common Unix Printing System (CUPS), a core component of Mac OS X, is free, open source software that provides a portable and extensible printing system for the Unix-based Internet Printing Protocol (IPP/1.1).

Extensive documentation and source code is available for CUPS online (http://www.cups.org). As noted in online documentation, the goal of CUPS is "to provide a complete, modern printing system for Unix that can be used to support new printers, devices, and protocols while providing compatibility with existing Unix applications."


CUPS provides System V- and Berkeley-compatible command-line interfaces and a web-based interface to extensive documentation, status monitoring, and printer administration. You access the web-based administration interface by pointing your web browser to port 631 on the localhost (http://127.0.0.1:631). (To access CUPS from a remote machine, enable Printer Sharing (System Preferences Sharing), and use your machines IP address instead of 127.0.0.1.) The main page of the web-based administrative interface is shown in Figure 6-7.

Figure 6-7. CUPS' web-based interface


6.2.1. Printing from Remote Systems

CUPS is available on a wide variety of Unix-based systems and makes both the administration and use of shared printers easy. For example, a shared USB printer connected to your Mac is immediately visible to a Solaris-based SUN workstation running CUPS, provided the Solaris machine is on the same subnet (if not, remote users can connect to the printer by supplying your Mac's IP address or hostname).

GNOME and KDE, the most popular desktop environments for Linux, have utilities that make it easy to connect to a printer you've shared from your Mac. Before you proceed, you should find out the queue name of your printer, as described in the following steps:

  1. Open the Printer Setup Utility (/Applications/Utilities).

  2. Select your printer and click the Show Info icon.

  3. The Printer Info dialog appears; make sure Name & Location is selected at the top of the dialog. Figure 6-8 shows the settings for an HP OfficeJet D135 connected to the USB port. The queue name for this printer is "officejet d series."

Figure 6-8. Inspecting the properties for an HP OfficeJet


6.2.1.1. GNOME

To connect to your Mac's printer from GNOME :

  1. Launch the GNOME CUPS Manager. This may appear in a menu (on Ubuntu Linux, select Computer System Configuration Printing), or you can run the command gnome-cups-manager. The CUPS Manager appears as shown in Figure 6-9.

  2. In Step 1, select Network Printer (CUPS Printer) and specify the URL of your printer. The URL is of the form http://HOST:631/printers/queuename, as shown in Figure 6-10. Click Next.

  3. In Step 2 (Figure 6-11), select the manufacturer and printer model. Click Apply. The Add a Printer dialog box disappears, and you'll be back in the GNOME CUPS Manager (an icon should now be visible for your newly-added printer).

  4. Print a test page. Right-click on the printer you just added, select Properties, and click Print Test Page from the dialog that appears (Figure 6-12).

Figure 6-9. The GNOME CUPS Manager


6.2.1.2. KDE

To connect to your Mac's printer using KDE, launch the KDE Control Panel and choose Peripherals Printers. You may find that your printer is already detected, as shown in Figure 6-13. Depending on whether your Linux system can resolve your Macs hostname properly, this printer may work as-is.

Figure 6-10. Adding a new printer under GNOME


Figure 6-11. Specifying the printer's make and model


Figure 6-12. Printing a test page


Right-click on the printer, select Printer IPP Report, and browse the results. If you see "Unknown host" and/or "Unable to lookup host" in the printer-state-message, it probably won't work out of the box.


In our case, it didn't work out of the box. You can follow these steps to add the printer manually:

  1. Click Add Add Printer/Class.

  2. The Backend Selection appears (Figure 6-14). Choose Remote CUPS Server (IPP/HTTP) and click Next.

  3. The next screen asks for use identification. Leave this set to the default (Anonymous) and click Next.

  4. Specify your Mac's IP address and CUPS port (normally 631) as shown in Figure 6-15. Click Next.

  5. You'll see a list of shared printers on your Mac, as shown in Figure 6-16. Choose one and click Next.

  6. The next screen asks you to select the printer manufacturer and model. Click Next when you're done.

    Figure 6-13. KDE will usually detect your shared printer


  7. The Driver Selection screen appears. This displays all the detected drivers for your printer, as shown in Figure 6-17. Choose the correct one, and click Next.

  8. At this point, you're prompted to test the printer. When we tried it, it didn't work, but it wasn't a showstopper. If it doesn't work for you, click Next anyway and keep on moving through the Wizard.

  9. There are a few more screens: Banner Selection, Printer Quota Settings, and Users Access Settings. Leave the defaults and click Next for each one.

    Figure 6-14. Specifying the CUPS backend for your printer


  10. The next screen asks for the printer name, location, and description. Specify something that you think is useful, and then click Next.

  11. The final screen shows you a summary of the selected settings. Review them, clicking Back if necessary to change anything, and click Finish when you are ready.

  12. After the printer is installed, you can right-click on it in the Printing Manager and select Test Printer to send it a test page.

6.2.1.3. Manual printer configuration (Linux and Unix)

You can also configure a CUPS client manually. To add your Mac OS X printer as the default printer, edit /etc/cups/printers.conf on the Linux (or other Unix) machine, and add the following entry, replacing OfficeJet-D135, 192.168.254.150, and officejet_d_series with the appropriate values:

     <DefaultPrinter OfficeJet-D135>     Info OfficeJet-D135     DeviceURI http://192.168.254.150:631/printers/officejet_d_series     State Idle     Accepting Yes

Figure 6-15. Setting the host and port


     JobSheets none none     QuotaPeriod 0     PageLimit 0     KLimit 0     </Printer> 

If you don't want the printer as the default printer, change DefaultPrinter to Printer. After you've added the entry, stop and restart CUPS on the Linux (or other Unix) machine to load the new printer configuration.

6.2.1.4. Printing from Linux

After you get your Mac and its printer to appear in the list, you don't need to do any further configuration. To print from an application such as Firefox, select the Print option from the application's main menu. Your Mac's printer will either appear by name, or show up as something simple like "PostScript/default," as shown in Figure 6-18.

Figure 6-16. Choosing the shared printer on your Mac


     < Day Day Up > 


    Mac OS X Tiger for Unix Geeks
    Mac OS X Tiger for Unix Geeks
    ISBN: 0596009127
    EAN: 2147483647
    Year: 2006
    Pages: 176

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