Home Server CUPS printing

Index.

10-Jun-2011: initial release.
01-Aug-2012: update for CUPS 1.6.0
23-Nov-2012: adjusted for Slackware and CUPS 1.5.4.
31-Oct-2013: fixed configuration and certificates.

 

Introduction.

Today CUPS is the standard print server on Linux. CUPS does work together with Samba which is used for the SMB file serving for Windows clients. This means that printers connected to the Home Server, or network printers that the Home Server can reach, can be made available to other Linux and Windows systems. We make a virtual PDF printer available too.

CUPS 1.5.4 shipped with Slackware 14.0 is not the latest bleeding edge version. For now this is good because versions from 1.6.0 and newer have a different method to discover printers using Avahi which Slackware still doesn’t need. In my opinion the current, old method works better then the new one because the old method has better auto discovery features.

 

 

Configuration.

Install cups from the standard Slackware distribution and build and install the cups-backend package that you can find on this site. Before you start the CUPS server, make some changes to /etc/cups/cupsd.conf so that you can configure the server from a workstation. Default the CUPS server is only reachable from localhost. The changes are bold printed.

# Only listen for connections from the local machine and LAN.
#Listen localhost:631
Listen 127.0.0.1:631
Listen [::1]:631
Listen 10.126.160.253:631
Listen [2001:1af8:fecf:7ea0::fd]:631
Listen /var/run/cups/cups.sock

Browsing On
BrowseOrder allow,deny
BrowseRemoteProtocols
BrowseAddress @IF(br0)
BrowseLocalProtocols CUPS
MaxJobs 50
ServerCertificate /etc/certs/homsrv.wpl.ym.crt
ServerKey /etc/certs/homsrv.wpl.ym.pem
# Restrict access to the server...
<Location />
    Order allow,deny
    Allow all
</Location>
<Location /admin>
</Location>
</Location>
<Location /admin/conf>

 

Then, add the two new backends (if you want them):

root@homsrv:~# lpadmin -p RAW_2_File -v raw2file:/mnt/users/printfiles/ -E 
   -D "Raw to files" -L "$(hostname -f)"
root@homsrv:~# lpadmin -p PDF_2_File -v pdf2file:/mnt/users/printfiles/ -E 
   -P /usr/share/cups/model/distiller.ppd -D "PDF to files" -L "$(hostname -f)"
root@homsrv:~# mkdir -p /mnt/users/printfiles
root@homsrv:~# chown lp:lp /mnt/users/printfiles
root@homsrv:~# chmod 755 /mnt/users/printfiles
root@homsrv:~#

 

Using the certificates management create a certificate for our homsrv. The name for the certificate is homsrv.wpl.ym. Then export the key and certificate. The certificate must be exported as PEM with chain. Place these files in /etc/certs.

Now you may start the CUPS server:

root@homsrv:~# /etc/rc.d/rc.cups start
cups: started scheduler.                                   [  OK  ]
root@homsrv:~#

 

Now point a browser to http://homsrv.wpl.ym:631/ to change your configuration. To make printers usable from Linux clients, make the printer shareable, and in the Administration page enable “Share printers connected to this system” too. To confirm your actions use the root account and password when asked to login.

 

 

PDF printing.

Together with cups we installed cups-backend. One of these is a simple virtual PDF printer that can accept plain text files and convert that to PDF files, but does accept PDF jobs too and prints these as they are. The configuration will be so that the print jobs end up in each users own subdirectory of their home directory. In fact solution this is a free alternative for Adobe’s Distiller.

A condition to let this work is that each user on your network needs to have an account on the Home Server, and that this name is exactly the same on the Home Server and client computer.  So, your Windows client computers need to use user names that are compatible with Linux. This is a good idea for other things too as you will see in other articles.

 

 

Download.

See the download page for the script and configuration files.