Debian Lenny, Avahi, AFP… Linux Fileserver for OSX Clients

Gravatar
Posted by apokalyptik

If you’re like me you have an OSX computer or 3 at home, and a debian file server. If you’re like me you hate samba/nfs on principle and want your debian server to show up in finder.  If you’re like me you arent using debian 3 which is what most of the walkthroughs seem to expect…  This is how I did it… With Debian Lenny.

What we’re using, and why:

  • Avahi handles zeroconf (making it show up in finder) (most howtos involve howl which is no longer in apt)
  • netatalk has afpd
  • afpd is the fileserver

From: http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/

  • apt-get update
  • mkdir -p ~/src/netatalk
  • cd ~/src/netatalk
  • apt-get install cracklib2-dev libssl-dev
  • apt-get source netatalk
  • apt-get build-dep netatalk
  • cd netatalk-2.0.3

From: http://www.sharedknowhow.com/2008/05/installing-netatalk-under-centos-5-with-leopard-support/

  • vim bin/cnid/cnid_index.c ## replace “ret = db->stat(db, &sp, 0);” with “ret = db->stat(db, NULL, &sp, 0);” line 277
  • vim etc/cnid_dbd/dbif.c ## replace “ret = db->stat(db, &sp, 0);” with “ret = db->stat(db, NULL, &sp, 0);” line 517

Mine

  • ./configure –prefix=/usr/local/netatalk
  • make
  • make install
  • vim /etc/rc.local ## add “/usr/local/netatalk/sbin/afpd”
  • /usr/local/netatalk/sbin/afpd

From: http://www.disgruntled-dutch.com/2007/general/how-to-get-your-linux-based-afp-server-to-show-up-correctly-in-leopards-new-finder

  • apt-get install avahi-daemon
  • vim /etc/nsswitch.conf ## make the hosts line read “hosts: files dns mdns4″
  • cd /etc/avahi/services
  • wget http://www.disgruntled-dutch.com/media/afpd.service
  • /etc/init.d/avahi-daemon restart

in case that file drops off the face of the net, this is its contents (except “< ?” is “<?” and “< !” is “<!”) :

< ?xml version="1.0" standalone='no'?><!--*-nxml-*-->
< !DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service -group>
<name replace-wildcards="yes">%h</name>
</service><service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>

At this point your server should show up under the network in your finder… and you should be able to connect with any system username/pw combo

6 Responses

  1. Barry Price says:

    Thanks, that’s exactly what I was looking for :)

  2. lolo6tm says:

    Worked great for a week but now i can’t access the serveur anymor. It does show up in the finder but i get “access refused” message.
    I’d like to try the package version from aptitude. How do you uninstall netatalk installed your way ?

    Thanks a lot.. and great work..

  3. Garrett Reid says:

    Thanks for the post, it was super easy to follow, and I now have an AFP server!
    One side note, for your ‘./configure –prefix=/usr/local/netatalk’ line, I used –prefix instead.

  4. Carson Cole says:

    Great work! Work’d like a charm the second (as usual for me) time. I skipped the -prefix option, although I see the benefits of having all the files under netatalk.

  5. [...] This post was mentioned on Twitter by Bernhard Ertler, Tux von Bux. Tux von Bux said: RT @BernhardErtler: bonjour installation für Debian hat super geklappt mit dieser Anleitung: http://bit.ly/5Lx2qM [...]

  6. John says:

    I wonder, is there something the matter with “apt-get install netatalk”

Trackback URL for this entry