Previous Page
Next Page

7.4. Configuring a CUPS Print Server

The Common Unix Printing System (CUPS) printer daemon can also be used as a print server, enabling other computers on the local network to access the printers it controls.

7.4.1. How Do I Do That?

Start the Printer Configuration tool shown in Figure 7-14. Highlight the printer you wish to share, select the checkbox labeled Shared, and then click Apply.

Figure 7-14. Printer configuration: sharing properties

Next, click on Server Settings on the lefthand side and select the checkbox labeled "Share published printers connected to this system." Click Apply.

You will need to open the IPP port 631 (ipp:tcp) in your firewall configuration (see Lab 8.1, "Prevent Unwanted Connections").

Your printer will now be accessible to other systems. Accessing a CUPS printer from Windows XP

To add a CUPS printer to a Windows XP system, select "Printers and Faxes" from the Start menu and click on "Add a printer." The Add Printer Wizard will appear.

Click Next to advance past the introduction. On the next page, select "A network printer, or a printer attached to another computer," and click Next. The window shown in Figure 7-15 will appear.

Figure 7-15. Adding a CUPS printer to a Windows XP system

Select "Connect to a printer on the Internet or on a home or office network," and enter a URI in this form:


Replace server with the hostname of the CUPS server if the Windows system can resolve that hostname using DNS; if you haven't configured DNS, use the IP address instead. Replace printername with the name of the printer as it is known to CUPS.

Click Next.

Select the manufacturer and printer model, and click Next (or, if the printer drivers are on a CD, click "Have a Disk" and select the disk location). Then click Finish to set up the printer. You can now use the CUPS printer from any Windows applications.

7.4.2. How Does It Work?

CUPS uses the Internet Print Protocol (IPP), which is based on the same HTTP protocol used by the Web. One shared virtual directory is mapped to each printer.

The CUPS configuration files are stored in /etc/cups, and the format of the main configuration file /etc/cups/cupsd.conf is very similar to the Apache configuration file (discussed in Lab 7.5, "Using the Apache Web Server"). Printer sharing is therefore enabled and disabled using Allow and Deny directives in the same way that they would be used to control access to an Apache directory. For example, global access to the printer laser0 could be configured like this:

<Location /printers/laser0>
    Order Deny,Allow
    Allow From All

7.4.3. What About... ...a client that uses the older LPD protocol?

If you wish to share the printer with a client that knows only the older Line Printer Daemon (LPD) protocol, such as an older Linux/Unix system or a Windows NT system, you will need to install the cups-lpd package.

To enable the service, start the Services tool (SystemAdministrationServices), select the On Demand Services tab, select the checkbox labeled "cups-lpd," and click Save. You can also enable the service by editing /etc/xinetd.d/cups-lpd, which looks like this:

# default: off
# description: Allow applications using the legacy lpd protocol 
# to communicate with CUPS
service printer
        disable = yes
        socket_type = stream
        protocol = tcp
        wait = no
        user = lp
        server = /usr/lib/cups/daemon/cups-lpd

Change the disable line to the following:

        disable = no

Save the file and restart the xinetd service:

# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

LPD printer sharing requires the printer port 515 (printer:tcp) to be opened in your firewall.

LPD emulation is enabled globally; there is no provision to share only some printers, or to share only with certain clients. ...configuring sharing from the command line?

Fedora does not provide a facility for configuring printer sharing from the command line. The only available option is to edit /etc/cups/cupsd.conf and insert the appropriate Allow and Deny directives (or, if you're accessing from a remote system, you may want to use X tunneling via SSHsee Lab 4.10, "Remote Management Using SSH").

7.4.4. Where Can I Learn More?

  • The CUPS manual: http://localhost:631/documentation.html

  • The manpage for cups-lpd

Previous Page
Next Page