Printing With Cups
Summary:
Tips And Tricks III
- Network
- Small networks
- Printer clusters
- Redundant queues
- CUPS & LPD on one machine - CUPS on Linux Mandrake 7.1
Tips And Tricks III
Networked printing
Small networks
In small networks, as they are very common at home or in a small office, there is only one machine, the server, which connects to the Internet, and each client uses this server as the gateway to connect. Often the printer is also connected to this machine. And because this machine has two Ethernet addresses, one for the Ethernet card connecting to the client(s) and one (usually dynamic) for the device connecting to the Internet, there are problems with the automatic broadcasting of printer information to the clients by CUPS. Here are step-by-step instructions to set up such a network so that both printer and Internet access work correctly. I assume that you have already set up Internet access on the server.
Note: All names and IP addresses in this example can be replaced, but be careful that you do not choose any unsuitable IP address. The address for the server should start with "192.168." (local network) and it should not conflict with the IP address of the Internet connection ( at least one of the first three numbers of the IP should differ from the IP of the Internet access).
First make sure that the server has a well-defined host name for the local network.
For this, install server and clients as follows:
On the server (the two steps can be done in any order):
- Start 'linuxconf', choose "Networking" and then "Host name and IP network devices".
Click on the tab for the network interface of your local network. Fill in the "Primary name + domain" field with "server.localdomain". Do not keep the name "localhost" or "localhost.localdomain" here. Set the IP address to "192.168.0.1" - Set up "Internet Connection sharing" with the appropriate subprogram of '~DrakConf'. If you access the Internet via a second network card, choose the one for the local network.
Click on the tab for the network board and mark the "DHCP" field.
Add an entry for your server name to '/etc/hosts'. For example add the line:
192.168.0.1 server.localdomain server
Reboot the server and the clients to make sure that all network settings are used by the machines.
On the server add the lines
~ServerName server<br> ~BrowseAddress 192.168.0.255
to '/etc/cups/cupsd.conf' and restart the CUPS daemon with
service cups restart
Now you have an automatic broadcasting for your local network and all the clients see your printers and can print on them.
Printer clusters
For high-demand printing you can set up printer clusters, consisting of several identical printers located in the same room. Jobs are sent to one queue and get distributed among all currently available printers.
To set up such a cluster, define one queue for every printer and unite all these queues in a class of printers. Choose "Printer"/"Add" in the menu of 'Kups' and then "Class of printers" in the "Backend selector" screen. On the next screen click on the first printer of the cluster, then on ">", on the second printer, on ">", and so on. Finally click on "Next", name the class and you are set. Classes can also be defined via the web interface: go to the "Manage Printer Classes" page, choose "Add class", enter the name of the class and then select the printers of your cluster.
On the command line you enter:
lpadmin -p <printer1> -c <class><br> lpadmin -p <printer2> -c <class><br> ...
Now send the printing jobs to the class and they will be printed on the next free printer of the class.
Redundant queues for one printer
If you have a very important Ethernet-connected printer, you can make it independent of one individual host by setting up redundant queues on different machines for it.
Enable the "Implicit Classes" facility on every machine in your network. This is a so-called implicit class: several queues with identical names exist on different machines in your network. The class will have the name of these queues and a job sent to this class will be put into the first queue responding. To turn on this feature, put the line
~ImplicitClasses On
into your '/etc/cups/cupsd.conf' and restart the CUPS daemon with
service cups restart
Or, if you prefer to use 'kupsdconf', turn on "Implicit Classes" under "Browsing".
Now set up eponymous queues for your Ethernet-connected printer on different machines. The printer will appear with a
{printer}@{server}
{printer}
CUPS and LPD on the same machine
Under Linux Mandrake it is even possible to have CUPS and LPD running on the same machine. This can be useful if you want to have the CUPS printers on the network available, but there is also a local printer with a driver for which there is no PPD file (all free drivers should have a PPD available on linuxprinting.org, if you find a free driver which is not mentioned there, please tell me).
If you just want to have one of your CUPS printers available on a machine running only LPD, use the CUPS-LPD mini-daemon.
To get LPD running you should at first turn off the automatic generation of an '/etc/printcap' file by CUPS: comment out the
Printcap /etc/printcap
service cups restart
Now install LPD and its printing filters with
urpmi lpr rhs-printfilters
and start the LPD daemon with
chkconfig ––add lpd<br> service lpd start
The commands
lpr
lpq
lprm
lpc
lpr-lpd
lpq-lpd
lprm-lpd
lpc-lpd
CUPS on Linux Mandrake 7.1
If you still have a machine with Mandrake 7.1 and you want to use CUPS, you can install the CUPS packages of Linux Mandrake 7.2. Proceed like this:
Stop LPD:
/etc/rc.d/init.d/lpd stop
and backup your '/etc/printcap' file. Remove the "lpr" package and related packages:
rpm -e ––nodeps lpr<br> rpm -e ––nodeps rhs-printfilters<br> ...
Download these RPM packages from a download site for Linux Mandrake 7.2 (or copy them from the first CD of Linux Mandrake 7.2):
- cups
- cups-drivers
- ghostscript
- ghostscript-module-X
- ghostscript-module-SVGALIB
- ghostscript-utils
- xpp
- qtcups
- samba
- samba-common
- samba-client
rpm -Uvh ––nodeps cups-1.1.4*.rpm
Set up links for easier access to the CUPS shell commands:
cd /usr/bin<br> ln -s lpr-cups lpr<br> ln -s lpq-cups lpq<br> ln -s lprm-cups lprm<br> cd /usr/sbin<br> ln -s lpc-cups lpc
Now install all the other downloaded packages with
rpm -Uvh {package file name}
Start CUPS with
chkconfig ––add cups<br> service cups start
Now you can configure and use CUPS as described in this article. Note that '~PrinterDrake' and 'Kups' are not available. Use the web interface of CUPS instead.
Related Resources:
See Resources on article index
Modified: Nov 24, 2000
Author: Till Kamppeter
Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
Version 1.3 last modified by AdminWiki on 22/03/2004 at 09:44
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!