Thursday, November 20, 2008

CUPS print server

I installed CUPS on my fit-PC mini Linux server to turn it into a USB print server.

Got a USB printer? Want to let several computers share it? Want to print to it wirelessly? Well you could buy a USB print server. Connect one of these to your router and your printer and you can share the printer on your network. If your router is wireless, you now have a wireless print server.

But since I already have an always-on mini Linux server, I can simply install CUPS on that and let it be my print server.

The setup
  • Fit-PC mini Linux server connected to my wireless router, as before.
  • USB laser printer (HP LaserJet 1010) connected to a USB port on the server.
  • CUPS installed and configured on the server to allow any PC connected to the router to use the printer.
  • Generic printer driver installed on Windows laptops so they can use the printer through the printer server.
So now I have a very handy wireless print server...
  • I can send stuff to the printer whenever I like.
  • The printer itself doesn't need to be turned on - just the server. Print jobs are spooled to the server.
  • When I want to collect printed pages, I just turn on the printer. The server detects it and sends the pending pages.
  • Pending print jobs are is written to disk, so even if you turn off the server, they are there when it restarts.
Installing and configuring CUPS on the server was straightforward.
$ sudo apt-get install cupsys
I Googled a bit for cupsys setup tips and made a few changes to /etc/cups/cupsd.conf.

For what it's worth, here's the diff between the default configuration (Ubuntu 8.04) and my current version.
$ diff /etc/cups/cupsd.conf.original /etc/cups/cupsd.conf
18a19
> Listen <my-server-ip-address>:631
27c28
< DefaultAuthType Basic
---
> DefaultAuthType None
31c32,35
< Order allow,deny
---
> Order deny,allow
> Deny From All
> Allow From 127.0.0.1
> Allow From 192.168.2.*
36a41
> Allow 192.168.2.*
58a64
> Allow 192.168.2.*
I think I had to restart the server once after installing cupsys, before I could access its web interface from my laptop. (Maybe apparmor related. I'm begining to think that reboot is required to allow any newly installed HTTP service available. Could be wrong there.)

Anyway, once it's setup right, you can point your browser to
http://<your-server>:631
to browse and manage the print server.

The setup on Windows laptops was very easy. I used "Add Printer" to add a network printer, specifying connect by URL, and a generic PostScript driver (I used Generic / MS Publisher ImageSetter).

There are of course many other ways to set it up, e.g. different printer driver options are covered here. But this is working out nicely for me.

No comments:

Post a Comment