Print service provided by iDogiCat: http://www.idogicat.com/
home logo





Home > IT > System Administration > Setup Netatalk

Setup Netatalk

iDog

Netatalk for Mac is Samba for Windows. Although it's possible to mount samba shared dirs in Mac, it's very slow, so setting up Netatalk in Linux is necessary.

Usually there is not a pre-built distribution to install, so we need to know how to do it from scratch.

Download source code from source forge cvs (use empty password). Note that for now (April 26, 2009), branch 2.0 should be used. The tag 2.0.3 is the last stable release, but it has two issues: one is i18n support issue; the other one is that it only uses old BDB, if yours is a new version, the code doesn't compile. Both were resolved in top of 2.0 branch.


> cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/netatalk login
> cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/netatalk -r branch-netatalk-2-0 co netatalk
Build it. Remember to specify your Linux distribution type, otherwise it has difficulties to install the scripts and config files correctly (use CentOS as an example).


c d /path/to/source/code
./configure --enable-redhat
make
make install

Edit config files. They are all in /usr/local/etc/netatalk. netatalk.conf: Disable AppleTalk protocal for two reasons: by default its not built in kernel; it's slow. So we will only use TCP (disable atalkd and papd). Also we need to change the default encodings. Make sure it's like follows:


...
ATALK_MAC_CHARSET='MAC_CHINESE_SIMP'
ATALK_UNIX_CHARSET='UTF8'
...
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
...

afpd.conf:


- -noddp -uamlist uams_dhx.so -advertise_ssh

AppleVolumes.default: define the shared dirs here.


~
/path/to/public   public
/path/to/dir1     dir1
/path/to/dir1     dir2

Setup service and start it:


> chkconfig --add atalk
> service atalk start

And don't forget to open port 548 in firewall.

Now we can connect to these dirs in Mac:

Press <Command>-k in Finder, enter 'afp://my_server_name' or 'afp://192.168.0.5' (supposing that it's the server's IP). Then enter user ID and password, and you get connected!