Mac OS X Leopard printing to Linux CUPS server

20090909-printing-press

I generally use my MacBook (running Mac OS X 10.5 Leopard) at work and it is essential for me to be able to print documents on my network printers attached to a Linux CUPS server (running CentOS Linux 5.3.)

What needs to be done on the Mac OS X Leopard computer

For some reason, Leopard cannot see printers shared by CUPS by default (it only sees Bonjour printers.) To rectify this, open a terminal and type:

sudo vi /etc/cups/cupsd.conf

and add “BrowseProtocols all” so that the file looks like this:

# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL
BrowseProtocols all
DefaultAuthType Basic
<Location />
# Allow shared printing…
Order allow,deny
Allow @LOCAL
</Location>
# Enable printer sharing and shared printers. Browsing On BrowseOrder allow,deny BrowseAllow all BrowseAddress @LOCAL BrowseProtocols all DefaultAuthType Basic &lt;Location /&gt;  # Allow shared printing...  Order allow,deny  Allow @LOCAL &lt;/Location&gt;

Then restart the CUPS daemon running on the Mac with

sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist sudo launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist

What needs to be done on the Linux server

Modify /etc/cups/cupsd.conf so that its beginning somewhat looks like this:

# Share local printers on the local network. Browsing On BrowseOrder allow,deny BrowseAddress @LOCAL DefaultAuthType Basic &lt;Location /&gt;   # Allow shared printing...   Order allow,deny   Allow @LOCAL &lt;/Location&gt;

and restart the CUPS server with one of:

/etc/init.d/cups restart /etc/init.d/cupsd restart

and everything should work from there. Go on your Mac and add your Linux printers in the usual way.

One observation I made

Printing generally works great but sometimes stop working when either the Mac or the Linux server are updated. What happens is that, during the update, the CUPS configuration (/etc/cups/cupsd.conf) gets slightly changed to something much more restrictive for security reasons (i.e. network printing is disabled.) I guess this is because both the Apple and Linux people think that it’s better be prudent than sorry especially in our era of fully opened Wifi network.

You’ve been warned :-)

  • Share/Bookmark

About avinash

I am the Managing-Director of Knowledge Seven Ltd, provider of quality consultancy, support and training for open source software. I am also an amateur photographer and musician. I use a Google Nexus One Android smartphone, an Apple MacBook, Mac OS X, Linux and a lot of open source software. I am married to Christina and we have two wonderful kids, Kyan & Anya. In case you are wondering, Noulakaz means "our home" in my native language, créole.
This entry was posted in Apple, Linux, Technology. Bookmark the permalink.

4 Responses to Mac OS X Leopard printing to Linux CUPS server

  1. sanjive says:

    Hello,
    I’v one question wrt java…

    Consider the following:

    int x = 42;

    How to get the memory address of X?

    Please, can you provide some help?

  2. avinash says:

    You can’t :-)

    Incidentally, the default implementation of hashCode() returns the address of that object. For example,

    Object o = new Object();
    System.out.println(o.hashCode());

    will print the address of o in memory. Unfortunately, hashCode() is overridden is a lot of subclasses of Object including Integer. This:

    Integer n = 42;
    System.out.println(n.hashCode());

    prints 42! Yeah. I know. It’s a pity. But it’s consistent with what a hash function is supposed to be :-)

  3. david says:

    Thanks. You can also make the changes via localhost:631 in administration and the cups server will be restarted automatically.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled