Search:  
Gentoo Wiki

HOWTO_Serving_Mac

This article is still a Stub. You can help Gentoo-Wiki by expanding it.

Contents

Introduction

Purpose

The purpose of this topic is to collect the information needed to provide the best share service for Mac on a Gentoo box.

Scope

References

Acronyms

Bonjour 
Apple's network service discovery method.

Service Announcer

Installation

You do not need the DBUS option if the avahi installation is only going to be a deamon. When no dbus is needed also add -dbus to the -qt3 and -qt4 below.

# echo "net-dns/avahi -qt3 -qt4" >> /etc/portage/package.use
# emerge --pretend avahi
#* You should only see a few packages.
#* The -qt3/4 is to avoid getting the whole X deal onto the server
#* Remove the '--pretend' when you are ready.

AFP Shares using Netatalk

HOWTO Share Directories via AFP

Advertise NFS Sharepoints with Avahi

Finder is able to autodetect NFS Shares in the Network by using ZeroConf. For that we will use an static Avahi Servicefile with the following Content.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Music</name> ## Name
<service>
       <type>_nfs._tcp</type>
       <port>2049</port>
       <txt-record>path=/media/music</txt-record> ## path to shared Folder
</service>
</service-group>

Save this Filem for example, as nfs_music.service under /etc/avahi/services. Now restart Avahi and see how those Shares get mounted with Finder.

This Function seems to be now broken in Mac OS X 10.5. A workaround is posted at http://www.macosxhints.com/article.php?story=20071116042238744

Advertise Samba Sharepoints with Avahi

Avahi can also be used for a faster discovery of Samba shares.

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

Broadcast Bookmarks over ZeroConf for Safari

It is possible to Broadcast Bookmarks of your Webinterfaces on your local Network with the help of Avahi. For that you need to create an static Avahi Servicefile with the following Content.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name>MythWeb</name> ## Name of the Bookmark
  <service>
    <type>_http._tcp</type>
    <port>80</port>
    <txt-record>path=/mythweb</txt-record> ## Path 
  </service>
</service-group>

Now restart Avahi and check the Bookmark Menu under Safari. There you will see how automatically they will appear, when those Services are available.

iTunes

There is a nice description here: Apple ITunes Server

Shared libraries (music, movies, podcasts, etc.) can be accessed from iTunes, Front Row, Apple TV, Rhythmbox, VLC, and more.

iTunes can have different shares for: music, podcast and sound books.

iPhoto

iPhoto uses dpap at port 8770. Once this is set up, one can browse shared photos via iPhoto or Front Row on a Mac, or from an Apple TV.

Please Note: Your photos must be named *.jpeg not *.jpg or this will show the share but with no photos in it.

Installation

You need to have avahi installed, see above for installation process.

You probably need to include the use flag 'jpeg' for imlib2 module.

# echo "~dev-perl/POE-0.38" >> /etc/portage/package.keywords
# emerge POE
# emerge imlib2
# emerge Image-Imlib2
# perl -MCPAN -e 'install Net::DPAP::Server'

Alternative to installing stuff through cpan add it to portage as ebuilds:

# emerge g-cpan
# echo 'perl-gcpan' >> /etc/portage/categories
# g-cpan -i Net::DPAP::Server
# emerge Net-DPAP-Server

dpap server script

File: /etc/dpap_srv
 use POE;
 use Net::DPAP::Server;

 my $server = Net::DPAP::Server->new(
     path => '/my/photo/album',
     port => 8770,
     name => "My holiday snaps",
 );
 $poe_kernel->run;

avahi service file

File: /etc/avahi/services/dpap.service
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> 
 <service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_dpap._tcp</type>
    <port>8770</port>
  </service>
 </service-group>
 


# /etc/init.d/avahi-daemon start

You must also run:

# perl /etc/dpap_srv

Note: this does not daemonize

Alternatively, use the Avahi Net::Rendezvous::Publish backend: http://search.cpan.org/dist/Net-Rendezvous-Publish-Backend-Avahi-0.02/lib/Net/Rendezvous/Publish/Backend/Avahi.pm

Troubleshooting

It will announce itself to mDNSResponder. This can be checked by running on OSX:

  1. mDNS -B _dpap._tcp
Retrieved from "http://www.gentoo-wiki.info/HOWTO_Serving_Mac"

Last modified: Fri, 05 Sep 2008 21:57:00 +0000 Hits: 13,341