Setting Up a Print Server


If you want to share a single printer (or group of printers) among a number of users, what you need is a print server . The print server manages the print requests and puts them into a queue for processing. It can manage the following:

  • Sharing of printers between many users

  • Authentication, so that only permitted users can print to a given printer

  • Print queues

  • Configuration of many printers in a single location

This section examines how to configure your Linux machine as a print server for managing print jobs.

Fedora 2 provides the Common UNIX Printing System (CUPS) print server software package. CUPS is a printing service for UNIX-based platforms, capable of managing printer jobs and queues and supporting network printer browsing.

The Fedora 2 installation process should install the cups package by default. To check, launch the RPM (for example, using Main Menu>System Settings>Add/Remove Applications), locate the Printing Support package group (which is under the System category), click its Details button, and ensure that the CUPS package is under the Installed Packages heading (see Figure 9-10).

Click the Cancel button to exit this dialog box, and exit the Add and Remove software screen. If the CUPS package is not installed on your system, install it using the guidelines in Chapter 8.

click to expand
Figure 9-10

Installing a Printer

When you first install CUPS, you get a default set of sample configuration files at /etc/cups . However, it s easier to manage your printers using the Printer Configuration Tool that is provided by Red Hat. Each printer has its own print queue , so you configure the print server by using the Printer Configuration Tool to add a print queue for each printer.

  1. To start the Printer Configuration Tool, select Main Menu>System Settings>Printing, or type the following command at the command line:

       $ system-config-printer   

    You are asked for the root password, unless you were already logged in with administrative privileges. The Printer Configuration window appears, as shown in Figure 9-11.

    click to expand
    Figure 9-11

  2. To add a print queue for a new printer, click the New button. This opens the Add a New Print Queue Wizard. Click Forward to get past the splash screen.

  3. The first thing you re prompted for is the name of the print queue you want to add. Type a unique name for the printer (for example, something like prntr_queue-1 ). If you want, you can also type a description that helps you to identify the printer (see Figure 9-12). Click Forward.

    click to expand
    Figure 9-12

  4. The next screen allows you to choose the queue type from the options in the table that follows .

    Label

    Type

    Description

    Locally connected

    LOCAL

    For a printer attached directly to your computer through a parallel or USB port

    Networked CUPS

    IPP

    For a printer attached to a different CUPS system and accessible through TCP/IP

    Networked UNIX

    LPD

    For a printer attached to a remote UNIX system and accessible through TCP/IP

    Networked Windows

    SMB

    For a printer attached to a remote Windows system and accessible through a Samba share

    Networked Novell

    NCP

    For a printer attached to a remote Novell Netware system

    Networked JetDirect

    JETDIRECT

    For a printer connected directly to the network with its own IP address

    This demonstration uses the LOCAL queue type. If you have a locally connected printer, select Locally-connected , and select a device from the list (such as /dev/lp0 ). Then click Forward.

    Note

    If you have a networked computer, select one of the other options and follow the wizard to complete the configuration.

  5. Next, you ll be prompted to select the make and model of your printer. When you ve done that, click Forward, and the wizard confirms the details you ve selected.

  6. The new printer now appears in the printer list in the main window. You ll also see the dialog box shown in Figure 9-13.


    Figure 9-13

    Click Yes to save the configuration changes to the /etc/printcap configuration file, restart the lpd printer daemon, and print a test page.

Configuring Printers

The Printer Configuration Tool provides a number of options for managing printers. For example, you can edit or remove the properties of a printer queue by selecting the queue and clicking Edit or Delete. You can also configure a particular printer to be the default by clicking the Default button. Whenever you make any changes, you must save them by clicking the Apply button (which also restarts the cupsd printer daemon to take account of your changes).

You can also test a printer from the Printer Configuration Tool, by choosing a printer and selecting any of the test configurations from the Test menu.

Starting (and Stopping) the Printer Daemon

To control the cupsd printer daemon, you can once again use the Service Configuration GUI. However, you may never need to do this manually ”the service is configured to start automatically on system startup by default, and restarts automatically if you change its configuration via the Printer Configuration Tool.

If you do need to control the service manually, you can do it using the Service Configuration GUI (as described in other sections of this chapter ”the service in question is called CUPS), or by using the service command at the command line to control the cups script:

   # service cups   Usage: cupsd {startstoprestartcondrestartreloadstatus}   # service cups restart   Stopping cups:                                          [OK] Starting cups:                                          [OK] 

Printing from Applications

By default, all applications send printing requests to the default printer configured on the system, but, if more printers are available, the application s Print dialog box allows you to choose which print queue to send the job to.

For example, if you re printing a word- processed document from the OpenOffice OpenWriter application, you d do so by selecting its File>Print option from the menu bar. When you do that, you get a Print dialog box like that shown in Figure 9-14.

click to expand
Figure 9-14

As you can see, the application offers you a list of printers to choose from. The list shown in Figure 9-15 includes an entry for the prntr_queue-1 printer that we configured earlier. It also includes a Generic Printer entry; if you choose this, the application will send the print job to your default printer (the one that your machine is configured to use automatically).

You ll need to configure the default printer before you use if for the first time; you can do this through the OpenOffice Printer Setup Tool. Select Main Menu>Office>Openoffice.org Printer Setup, select the Generic Printer entry in that dialog box, and click the Properties button.

In the resulting Properties of Generic Printer dialog box, the default command in the Select Command section is lpr ”this sends printer jobs via the lpr command to /dev/lp0 as the default print queue. Change the command to lpr -P printername , where printername is the name you gave to your printer. Then click OK to save these settings.

Now you can return to your Writer application, select File>Print, and select the Generic Printer option in the Print dialog box to send the job to that printer.

Creating Print Jobs at the Command Line

The lpr utility you ve just seen can also be used to create print requests from the command line. For example, if you want to print a text document called addresses.txt , contained in the present working directory, you can do so by typing the following at the command line:

   $ lpr addresses.txt   

You can also examine and control existing print jobs via the lpq and lprm command line utilities of the CUPS software suite. The lpq command allows you to view the contents of the print queue, and can be used as follows:

   $ lpq   ptntr_queue-1 is ready and printing Rank      Owner    Job    File(s)                 Total Size  active    root       1    testprint.ps            15630 bytes 1st       kapils     2    (stdid)                 5761024 bytes 2nd       eziodm     3    (stdid)                 193536 bytes 3rd       eziodm     3    addresses.txt           1024 bytes 

If you want to cancel a print job, use the lprm command. For example, to remove the job with ID 838 from the print queue, issue the following command:

   # lprm 838   

Of course, if you try to cancel another user s print job and you don t have permission to do so, CUPS prevents you from canceling it. For example, suppose the user eziodm tried to cancel job 2 in the preceding list:

   # lprm 2   lprm: You don't own job ID 2! 
Note

You can learn more about the CUPS printing system at www.cups.org/ .




Beginning Fedora 2
Beginning Fedora 2
ISBN: 0764569961
EAN: 2147483647
Year: 2006
Pages: 170

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