Justin Walker


Install AirPrint On Ubuntu Server 8.04

Apple’s AirPrint technology in iOS is great, that is if you have a special AirPrint enabled printer.  Unfortunately for the majority of us we already have a printer and have no intentions of purchasing a new one anytime soon.  I’m in that boat, I’ve been very happy with my Brother laser printer, but I want to be able to print from my iPad.  I have seen several paid software solutions like FingerPrint, but all of them require that the computer that it is installed on is turned on.  Since there are only laptops in my house, this solution doesn’t work as well.  What I do have though is an old AppleTV running a linux server on it.  This is always on and ready to go.  I had looked into getting AirPrint working using my server before, but the task seemed rather daunting.  I finally sat down and figured it out, and it turned out to be rather straightforward.  I had to piece together various bits of information to get this working with my setup, but here are the steps….

Steps to install AirPrint on ubuntu server 8.0.4

  1. install CUPS.  Installing CUPS on 8.0.4 is different compared to newer versions of Ubuntu.  If you have a newer version, just do a Google search for it. https://help.ubuntu.com/8.04/serverguide/cups.html

  2. edit the config file

sudo nano /etc/cups/cupsd.conf

make the following changes:

# comment out the follow two lines
#Listen localhost:631
#Listen /var/run/cups/cups.sock

# add these two lines
Port 631
ServerAlias *

<Location />
Order allow,deny
Allow @LOCAL # add this line

<Location /admin>
Order allow,deny
Allow @LOCAL # add this line

  1. Visit the CUPS web interface to configure the printer.  Replace the IP address with that of your linux server. admin > find new printers select options to configure or upload .ppd file from manufacturer

  2. Install avahi
    sudo apt-get install avahi-daemon
  3. create new file
    sudo nano /etc/avahi/services/printer.service

Paste the following code into new file.

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <name>Brother MFC-7840W</name>
 <txt-record>ty=Brother MFC-7840W</txt-record>
 <txt-record>note=Brother MFC-7840W</txt-record>
 <txt-record>product=virtual Printer</txt-record>

*rp and adminurl are the most important data nodes, you can determine the adminurl by going to the CUPS web interface, clicking on the printers tab, the click the printer name, the resulting URL is what you will use

  1. restart avahi service
    sudo /etc/init.d/avahi-daemon restart
  2. go to your iOS device and print! References: https://help.ubuntu.com/8.04/serverguide/cups.html http://gyttja.wordpress.com/2010/11/11/airprint-on-ubuntu/ http://www.micromux.com/2010/11/22/airprint-for-mac-on-linux/

note: there are other posts on this topic that reference running a python script to generate the avahi “printer.service” but I personally could not get the script to work. This might be perhaps because I am running an older version of ubuntu. Simply copying the xml text and saving to printer.service and changing the data points to reflect your setup will also get the job done. Some of the other data points are fairly straight forward and you can change them accordingly. Unfortunately I am not familiar with some of the more obscure ones, so you will have to either leave them (hopefully it will just work) or play around with them.  At some point I might get around to updating this post once I figure it out.

Like with many tutorials and guides on various topic there isn’t always a one-size-fits-all, so that’s why I’ve made this post.  I had to grab information from various different sources to get this to work with my setup.  I hope this helps!

Load Comments