Install Netatalk v3 on Debian

From Netatalk Wiki
(Difference between revisions)
Jump to: navigation, search
Line 81: Line 81:
 
</blockquote>
 
</blockquote>
 
Crucially, confirm that <tt>DHX2</tt> appears under the <tt>UAMS</tt> section of the report---this is essential for the authenticated login of clients.  All being well, you can proceed with installation.
 
Crucially, confirm that <tt>DHX2</tt> appears under the <tt>UAMS</tt> section of the report---this is essential for the authenticated login of clients.  All being well, you can proceed with installation.
 +
 +
Now that you have configured your installation, you can proceed to build Netatalk:
 +
make
 +
This is the longest part of the process.  You may wish to take this opportunity to prepare a beverage.
  
 
==Installing Netatalk 3 using Checkinstall==
 
==Installing Netatalk 3 using Checkinstall==
Line 97: Line 101:
 
|}
 
|}
 
<br />
 
<br />
Now that we have configured our installation, we can proceed to build Netatalk:
 
make
 
This is the longest part of the process.  You may wish to prepare a beverage.
 
  
Once <tt>make</tt> is finished building, we install using CheckInstall:
+
Once <tt>make</tt> has finished building, you install using CheckInstall:
 
  checkinstall make install
 
  checkinstall make install
When done, you should receive a clear indication as to the results of the install process.  All being well, there remains just one more step.
+
This moves all the Netatalk components into place, and integrates them into the system.  When done, you should receive a clear indication as to the results of the install process.  All going well, there remains just one more step.
  
 
Execute the following commands:
 
Execute the following commands:

Revision as of 09:32, 27 April 2013

Contents

Introduction

NB: This page is a work in progress (WIP). If you see this disclaimer, please be aware the the walkthrough presented below may be incomplete or may contain errors resulting in a broken install.

As of the date of creation of this page (27th April 2013), Netatalk v3 has yet to reach any of the currently-available Debian branches (stable, testing, unstable or experimental)---in fact, the latest version offered is 2.2.2-1. Given the significant improvements in v3, it seemed prudent to offer a walkthrough on obtaining, compiling and installing Netatalk v3 from source on this platform.

This walkthrough comprises the steps taken by someone unfamiliar with either Debian or compiling, and results in a working install of Netatalk v3.0.3 capable of sharing the Debian user folders, and shared volumes, via a relatively secure authenticated login. It does not comprise any steps allowing for Bonjour auto-discovery, as the target machine was being optimised for energy-savings.

All steps were undertaken via an SSH connection from a local client machine, so some acquaintance with use of the Command Line Interface is advisable, though probably not necessary, as this should be fairly straight-forward.

Obtaining the Netatalk 3 source code

The source code for Netatalk 3 is made available on the home page of the Netatalk website. For the purposes of the following section, the gzip version is used. You can download it any way you choose, but ultimately the downloaded file has to be transferred to a dedicated folder on the target machine. In this section, Wget will be used. If this isn't already installed, it can be obtained through apt-get or aptitude.

Start by logging on to your Debian machine, creating the dedicated folder within which the following steps will be performed and navigating into it. Then, download the source code:

wget -O ./netatalk3source.tar.gz insert_url_here

This will create a file called netatalk3source.tar.gz in your current directory. Decompress it with:

gunzip ./netatalk3source.tar.gz

Then:

tar -x -f ./netatalk3source.tar

You will now have a new directory entitled Netatalk 3.0.3, and the original netatalk3source.tar file. You can keep the latter file for future install purposes, or delete it: the choice is yours.

You should now navigate into the new directory, and proceed to the next section.

Compiling Netatalk 3 with the required dependencies

NB: If you've never compiled from source on this machine before, it's possible you may be lacking a Compiler, the software that turns source code into the operating system-specific package. It can be be obtained as follows:

apt-get install gcc

If GCC is already installed, you will be notified; otherwise, it will be installed. Once this has finished, you can continue with the rest of this section.

You now need to install the required dependencies before proceeding:

apt-get install libgcrypt11-dev libdb4.8-dev

Once this has finished, you can proceed with configuring the proposed install:

./configure --enable-debug --with-cnid-dbd-backend --with-init-style=debian --with-acls

This will take some moments, depending on the speed of the machine. On successful completion, you will see a report similar to the following:


Using libraries:
    LIBS           = -ldl 
    CFLAGS         = -I$(top_srcdir)/include -I$(top_builddir)/include -D_U_="__attribute__((unused))" -g -O2
    PTHREADS:
        LIBS   = 
        CFLAGS = -pthread
    LIBGCRYPT:
        LIBS   = -lgcrypt
        CFLAGS = 
    BDB:
        LIBS   =  -L/usr/lib64 -ldb-4.8
        CFLAGS = 
    LIBEVENT:
        bundled
Configure summary:
    INIT STYLE:
         debian
    AFP:
         Extended Attributes: ad | sys
         ACL support: yes
    CNID:
         backends:  dbd last tdb
    UAMS:
         DHX2    ( SHADOW)
         clrtxt  ( SHADOW)
         guest
    Options:
         Zeroconf support:        no
         tcp wrapper support:     no
         quota support:           yes
         admin group support:     yes
         valid shell check:       yes
         cracklib support:        no
         ACL support:             yes
         Kerberos support:        auto
         LDAP support:            no
         dbus support:            no
         dtrace probes:           no
    Paths:
         Netatalk lockfile:       /var/lock/netatalk
         init directory:          /etc/init.d

Crucially, confirm that DHX2 appears under the UAMS section of the report---this is essential for the authenticated login of clients. All being well, you can proceed with installation.

Now that you have configured your installation, you can proceed to build Netatalk:

make

This is the longest part of the process. You may wish to take this opportunity to prepare a beverage.

Installing Netatalk 3 using Checkinstall

Before continuing, a brief explanation: one of the main problems that can arise from installing software from source is that it becomes more difficult to manage certain future tasks, such as removal. To this end, this walkthrough employs CheckInstall, which allows the resultant install to be managed with the dpkg utility. Should you wish to uninstall Netatalk 3 at some point in the future, this can be accomplished using the following command:
dpkg -r netatalk

To test this at the end of the installation process, you can use the following:

dpkg --dry-run -r netatalk

The result should be along the lines of:

(Reading database ... 35527 files and directories currently installed.)
Would remove or purge netatalk ...

Simples!


Once make has finished building, you install using CheckInstall:

checkinstall make install

This moves all the Netatalk components into place, and integrates them into the system. When done, you should receive a clear indication as to the results of the install process. All going well, there remains just one more step.

Execute the following commands:

echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

This adds the path to Netatalk's essential libraries to the system. Without this, an error would be returned when attempting to run Netatalk, and the service would fail to start.

It now only remains to configure Netatalk to offer up a share.

Configuring Netatalk 3 for client access

As stated in the Introduction, the aim of this walkthrough is to enable authenticated access to users' home folders on the server. These are managed through the afp.conf file, full usage details of which can be found here.

Open the configuration file with your preferred text editor:

vi /usr/local/etc/afp.conf

Unlike many configuration files, this file uses semi-colons to denote comments. Remove the leading semi-colon from the line containing [Home], then enter the following line on a new line just below:

basedir regex = /home

Save the file.

You can now launch Netatalk:

/etc/init.d/netatalk start

Attempt to log in from a client on the LAN. From the Finder in OS X 10.8, one of the ways you can do this is from the Go menu, entering the following in the resultant dialogue:

afp://ip.ad.dr.ess/

After hitting Connect you should immediately be offered an authentication dialogue. Enter the username and password of a user on the server, and proceed. On successful authentication a new Finder window should open allowing access to that user's home folder.

And you're done!

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox