Using CUPS to share printers across your network.
Motivation
Most things in my house are networked so it was with some disappointment that we had to replace a laser printer at home but couldn’t afford one with a network card in it. Keeping the printer in the garage away from “sticky fingers” meant that having it connected to the network was imperitive.
I had an old Dell Optiplex GX110 with 256MB of RAM and running Windows Server 2000 (very slowly!) and thought it was time to recyle it with something a little more streamlined. As it was going to sit in the garage (as it has for the last couple of years), having something with a GUI was going to be a waste… So as usual, Ubuntu to the rescue.
Being Ubuntu meant I could experiment with Unix (read:Linux) and secure it a bit better. It also meant I could install the BIND9 and DHCP3 processes (see previous entries) as well as the Apache2 server so I could try and teach myself PHP scripting (but that’s another story…) CUPS was a perfect solution, allowing me to connect the laser printer to the linux server and giving me web access to administer it.
A fresh coat of paint
The base install of Ubuntu server 10.04 took about 30mins, with standard configuration and declaring a static IP. Once the install was completed I checked for any updates
sudo aptitude update sudo aptitude safe-upgrade
then installed the components I needed
sudo aptitude install cups
Selecting this package will install about 53 different components depending on what’s already installed! It’s only about 25MB so answer Yes and let it continue.
Whoops!
I haven’t had a chance to finish this documentation, but I’ve included a copy of my cupsd.conf for anybody to reference until I do… You can also find more information about configuring the cupsd.conf file here, at the CUPS website.
You can find the the conf file in /etc/cups/
sudo vi /etc/cups/cupsd.conf
ServerAdmin admin@example.com
# Only listen for connections from the local machine.
Port 631
Listen /var/run/cups/cups.sock
# Show shared printers on the local network.
Browsing on
BrowseOrder allow,deny
BrowseAllow @LOCAL
BrowseLocalProtocols CUPS dnssd
# BrowseAddress @LOCAL
# Default authentication type, when authentication is required...
DefaultAuthType Basic
# Restrict access to the server...
<Location />
Order allow,deny
Allow @LOCAL
</Location>
# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
Allow @LOCAL
</Location>
# Restrict access to configuration files...
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow @LOCAL
</Location>