16. Printserver

Introduction

It's easy to share the printer connected to your parralel port of the knoppixbox. Really easy. So, why not?

What you need to realize, is that the print server that we are installing on our knoppixbox is dumb. So dumb, it would not know a PDF file from a porn piccy. Actually all it does is get the data via a TCP/IP connection and dump it to the printer. You will need to make sure the data is formatted for your printer client side.

This means you will have to install the Printer Drivers on each and every client on the LAN. There are ways around this using the Fileserver from the last section, but for now we'll have to do with just this: install every printdriver on every client using the printer.

Installing and Configuring the Printserver

Actually, it's easy as installing one package, and starting it. All we need is to install the lpr package, and it's installed like any other package, with the apt-get command.

For some reason, the default comes with only local printing, so we need to change the /etc/default/lpd file to not have the OPTIONS="-s" line. Replace that line with a regular OPTIONS= empty line.

Once again, for the configuration file, I will just dump you my configuration file. It could do with some annotation, I know, but if you have a printer connected to the parallel port of your computer, this should do.

Code listing 16.1: The /etc/printcap file

# /etc/printcap: printer capability database. See printcap(5).
# You can use the filter entries df, tf, cf, gf etc. for
# your own filters. See /etc/filter.ps, /etc/filter.pcl and
# the printcap(5) manual page for further details.

Laserjet1100|Generic dot-matrix printer entry:\
        :lp=/dev/lp0:\
        :sd=/var/spool/lpd/lp:\
        :af=/var/log/lp-acct:\
        :lf=/var/log/lp-errs:\
        :pl#66:\
        :pw#80:\
        :pc#150:\
        :mx#0:\
        :sf:
        :sh:


Once you've done this, you can just start the printer by issuing /etc/init.d/lpd start and you should see the printer popping up in the explorer of a windows client if you connect to the computer via the Fileserver (i.e. samba). If you connect with an Apple client you will not be able to use this approach and you need to manually add the printer with the proper IP-address.

Configuring the Firewall

Should you connect to the printer only using the Samba fileserver, you will not need to have any adaptations on your firewall, as all network traffic will go over the SMB channels. However, if you are like me, and you print from a Mac once in a while, you want to talk with the lpd daemon directly, and you need to open the port on the firewall. This table shows the one line you need to add to the configuration of the firewall.

Action Source Destination Protocol Source ports Destination ports Comment
Accept Zone Local Firewall TCP Any 515 Allow traffic from the local network to the lpd daemon.

line
Updated $LastChangedDate: 2004-11-05 23:24:59 +0100 (Fri, 05 Nov 2004) $
line
Kristof Van Landschoot
Author

line
Summary: Installing a Print server makes sure that everyone on the local network can use the printer, not just the person sitting at the computer attached to the printer.
line
Copyright 2003-2004 Coin-C bvba. Questions, Comments, Corrections? Email knoppix@coin-c.com.