CUPS and Sun
I recently spent some time getting one of my long term projects built. For quite some time I've had an old desktop computer serve as my printer server. As this machine is kind of loud, I've turned it off when not using it. This led to some client machines not appreciating the printer becoming available at the wrong time.
In my posession I also had an old mini-itx board with passive cooling (large heat sinks) and a pair of sun portable scsi hdd cases. Incidentally, the latter fit into the former. The plan for a new print server was born.
The build itself turned out to be pretty straightforward. A 8GB CF-card serves as harddrive and an 80W pico-PSU was used to move the AC-DC conversion outside the box to a power brick delivering 12V DC. The resulting system is dead silent and does not use much power.
On the software side I installed debian. This was for two reasons: the debian netinst images helps installing a compact system without having to download gigabytes, and debain comes with a kernel that plays nice with my old Via C3 processor (which lacks the optional i586 cmov instruction).
Having run the installer and installed a minimal system, time came to install the printer server functionality. This is easier than you might think, simply apt-get install the cups package. I installed some of the recommended packages as well, but basically cups will do it.
Having installed cups, you need to tweak the /etc/cups/cupsd.conf to make cups available to the rest of the world. The Listen localhost:631 line can be changed to Listen 631. BrowseAllow should allow all. Also, the Location / tag needs the line Allow all. After these changes, simply restart cups using /etc/init.d/cups restart. Now you should be able to reach your new machine as ip.of.the.machine:631.
The cool kids now open localhost:631, pick admin, log on and add the printer. However, here, the coolest browser is Lynx and I don't feel lika configuring printers using Lynx. Instead, I do it over the command line. How do you do this? Basically, it takes three steps. First, use lpinfo to locate your printer(s). You might want to run this as root, as it is located in the /usr/sbin directory.
# lpinfo -v network socket network beh direct usb://HP/color%20LaserJet%202550%20series network http network ipp network lpd direct parallel:/dev/lp0 direct scsi serial serial:/dev/ttyS0?baud=115200 network smb
As you can see, a whole range of options are listed, but one item is the printer in question - in this case my old trusty HP2550. The lpadmin command is then used to add the printer to the system. In the line below, it is added with the name hp2550, -v specifies the printer in question and -P picks out a ppd file (i.e. a printer configuration).
# lpadmin -E -p hp2550 -v "usb://HP/color%20LaserJet%202550%20series" -P /usr/share/ppd/cups-included/HP/laserjet.ppd
The -E option is important as it enables the printer in cups and starts accepting jobs for it. You can do this afterwards using the following commands if you'd like to.
# cupsenable hp2550 # accept hp2550
Another tweak that is good to know is how to set the default printer.
# lpadmin -d hp2550
For some reason the laserjet.ppd did not really cut it for my needs. For instance, the results came out as black and white. Using the printer database over at http://www.openprinting.org/printers, I was able to retreive a new ppd for my printer. Then I simply replaced the ppd in the /etc/cups/ppd directory and I had color printing. For the fine tuning, the lpoptions command is handy. For instance, changing the paper size to A4 as as simple as this. Just entering lpoptions without any arguments prints out a list of settings for each printers. From this list, you can figure out which options to tune.
# lpoptions -p hp2550 -o media=A4
Now I can add the printer as a PostScript printer is both Linux and Windows and it Just Works. With my new print server hardware it will always be on and the box looks so pretty in my geeky eyes. FYI, I do power off the printer when it is not used, but the server simply queues jobs.
Johan Thelin is a consultant working with Qt, embedded and free
software. On-line, he is known as e8johan.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Reply to comment | Linux Journal
8 hours 39 min ago - Dynamic DNS
9 hours 13 min ago - Reply to comment | Linux Journal
10 hours 12 min ago - Reply to comment | Linux Journal
11 hours 2 min ago - Not free anymore
15 hours 4 min ago - Great
18 hours 51 min ago - Reply to comment | Linux Journal
18 hours 59 min ago - Understanding the Linux Kernel
21 hours 14 min ago - General
23 hours 43 min ago - Kernel Problem
1 day 9 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
this article is really
this article is really nice,When read this article i feel great...!thanks for posting it..! Leanspa
lynx and configuring CUPS
Unfortunately, recent versions of CUPS appear to demand javascript, so configuration with lynx no longer works.
Mate thanks very much for the
Mate thanks very much for the article and some very useful information.
And on behalf of the great majority of normal people, apologies for the seriously sad people who seem to have infected this page.
Hi Johan, thanks for taking
Hi Johan, thanks for taking the time to write about your experiences making a print server. It gave me some clues about setting up my own server and taught me something about command line administration.
Please don't be put off by the vitriolic outpourings of a frustrated wannabe who is too scared to even put his name to a rant. There are a few people like him out there
but most people seem to have more appreciation for somebody who tries to embody the linux spirit by helping others.
cheers
Pete
Not only poorly written but also amateur to the bone.
The epitome of laziness. You had to install a foreign file, that btw breaks ucf and Debian's package manager database, when all you had to do was to "locate laserjet | pager-of-your-choice" to scroll the output and find:
/usr/share/ppd/hplip/HP/hp-color_laserjet_2550_series-ps.ppd
and then choose it as the PPD for your printer. There, I found out the file for you.
Children, here we have another example of the hoof and horn school of system administration.
Breaking stuff
Sorry to upset you by introducing a foreign file. I could not locate the ppd as I had not installed hplip (due to laziness, yes). However, I'm not sure if I'm actually broken ucf nor the package manager database. Note, the following lines are just my understanding of how things work - feel free to correct me if I'm wrong.
The ppd I put in /etc/cups/ppd is not handled by the package manager per se. It is copied there by the lpadmin command. Thus, I would not say that I broke the package manager database.
The ppd I put there is a configuration file, which affects ucf. However, I'm not sure that I broke it. If a package being updated wants to change my ppd, it will simply present me with the usual options (keep yours, use the new, merge manually, or whatever they are). Thus, this is not worse that modifying a configuration file by hand, and that is a routine task for me.
You may call that sloppy system administration if you like. However, modifying configuration files is, in my world, what they are there for. If the files are deadly important, I try to version control them. I also keep a wiki with the setup details for all my critical systems so that I can re-configure a new server to the same status easily.
Regarding poorly written, please see my remark further down the comments. No excuses, but a promise to improve.
Johan Thelin is a consultant working with Qt, embedded and free
software. On-line, he is known as e8johan.
Why was this article not
Why was this article not proof-read? There are copious grammatical and spelling errors. Linux Journal, please strive for quality.
heh speling
Yeah, lots of errors! LJ, you're not wasting paper when you make corrections on a Web page :) Please, this is a good article that deserves proper editing.
Spelling, time and no excuses
I'm sorry that the blog entry was sub-par. To my defense, I'm not a native speaker, but I will do what I can to improve. Unfortunately, I had no-one to bounce this particular article by when writing it up (in a spur of inspiration on my n900).
Unfortunately, I cannot edit and correct what has been published, all I can do is promise to take more care in the future. I hope that you enjoyed the contents, and that you will enjoy the reading experience in the future.
Johan Thelin is a consultant working with Qt, embedded and free
software. On-line, he is known as e8johan.
Perfect timing!
Nice post... great timing considering we can now setup cloud printing on nix (https://github.com/armooo/cloudprint)!
Looks like this weekend just got booked up.
Cool project!
Love the old-school Sun hardware! I've got an old Sun lunchbox that I've been planning to do the same project with, except with the addition of a large hard drive for a print/NAS combo. I guess I have no more reasons to put it off...
Lunchboxes
I had such a machine (SparcClassic) for years, serving as a print and FAX server (serial modem, external ISDN converter, sendfax+mgetty). Unfortunately it finally broke a few months ago and though they are dirt cheap and still available I won't replace it, as Debian/sparc32 (AFAIK the last existing distro supporting sun4m) has been dead for years now and the last version of Solaris to support Sparc32 was some intermediate update of 9. No chance to get that one from the new Overlords...
It's a shame as there must be thousands of these machines still around and working.