Last night I finally got around to consolidating the household music collection and making it available to all the personal computers on our network.
I had originally shared my music on the network from my Mac, but this only worked when I was logged in and when iTunes was running. When Cat was logged in on the same machine, she didn’t have access to our music collection in my home directory.
Even if we were able to somehow share a music folder, one of us would need to remain logged in with iTunes running for any other clients on the network to have access to the library.
Fortunately, my CentOS Linux server had already been configured to backup the Mac’s iTunes music collection nightly via rsync, so it had its own mirror of what was on the Mac. I just needed to find a way to make that library available to all the Mac and PC users on my network as an iTunes share.
I discovered several approaches on the Web, but came up with a solution with a bit of custom configuration based on several resources. Now, whatever is ripped to or bought via the iTunes Music Store on the Mac is made available to all users via Apple RendezVous/Bonjour using the DAAP protocol implemented by Firefly Media Server (mt-daapd) on the local subnet.
In the steps below, 192.168.1.2 corresponds to the CentOS 4.4 x86_64 Linux server, 192.168.1.3 is the Mac OS X 10.4.8 running iTunes 7.0.2.
- First, here is the nightly rsync line configured to run on the Linux server. I use keys to run the script over SSH.
[firstname.lastname@example.org]$ vi rsync-itunes.sh
rsync -av -e "ssh -i /home/dan/rsync-key" \
192.168.1.3:\’‘/Users/dan/Music/iTunes/iTunes Music/’\’ /home/dan/iTunes
- Install the libid3tag RPMs so that the Linux server can interpret music file metadata.
[email@example.com]# rpm -i libid3tag-0.15.1b-3.2.el4.rf.x86_64.rpm
[firstname.lastname@example.org]# rpm -i libid3tag-devel-0.15.1b-3.2.el4.rf.x86_64.rpm
- Build the mt-daapd daemon from source, since there was no RPM for my platform.
[email@example.com]# tar xvzf mt-daapd-0.2.4.tar.gz
[firstname.lastname@example.org]# cd mt-daapd-0.2.4
[email@example.com]# ./configure –prefix=/usr/local
[firstname.lastname@example.org]# make install
- Copy some example configuration files from the distribution.
[email@example.com]# cp contrib/mt-daapd.conf /etc
[firstname.lastname@example.org]# cp contrib/mt-daapd.playlist /etc
- Change the default configuration.
[email@example.com]# vi /etc/mt-daapd.conf
- Perform some initial setup, which shouldn’t be necessary if you are installing mt-daapd from an RPM instead of source.
[firstname.lastname@example.org]# mkdir -p /var/cache/mt-daapd
[email@example.com]# cp contrib/mt-daapd /etc/init.d
[firstname.lastname@example.org]# vi /etc/init.d/mt-daapd # Make some path changes for my environment
[email@example.com]# chmod +x /etc/init.dmt-daapd
[firstname.lastname@example.org]# /sbin/chkconfig –add mt-daapd # Configure mt-daapd to run at startup
[email@example.com]# chmod o+r -R iTunes # Allow the daemon to read the audio files in my home directory, in case it’s not running as me.
[firstname.lastname@example.org]# /etc/init.d/mt-daapd start
- With that, the share was now available to the PCs and Macs on my network. To debug any other issues, I tailed the log.
[email@example.com]# tail -500f /var/log/mt-daapd.log
That was basically it. I’m still working on customizing things further, and I still keep a local copy of my music on the Mac to synchronize with my iPod.
Here’s a list of resources I consulted to get things going. Google Linux iTunes Server for more.
The package I got is faster than the standard cable offering and, most importantly, doesn’t block ports so I can continue to host my own mail and Web servers (which is the reason I’ve had to put up with DSL for so long). If you live in the Cablevision service area, do yourself a favor and check out Optimum Online Boost.
I’ve moved the remainder of my sites over to the server at home now, including this blog and the Civet Networks site. Good times for all (as long as the paint fumes, sawdust, cat hair and frost don’t get to the machine before you do).
Yet another DSL update. I woke up Monday morning to find that my connection was out. Turns out somewhere along the line the phone company decided that I had submitted a cancellation of service order and removed my brand new connection at the central office. It took 4 days to find that piece of information out, and now I have to wait till November 9th for a new connection. Awesome.
Well, I suppose I’ll have to recant my earlier entry. I’m now in the new apartment with my Speakeasy DSL successfully transferred over and two days ahead of schedule. My router needed no new settings, and the static IP address remained the same. So all I had to do to get the sites below back on line was plug in the DSL modem, connect the router, and fire up my eServer (sans keyboard, mouse, and monitor).
It’s that time again. I’m moving and that means yet another transfer of my DSL service from one apartment to another. At least I know what to expect, though that never has eased the experience of the previous 4 times I’ve awaited DSL activation. I have abandoned hope. Expect krook.org, krook.info, strongbrain.org, playagiron.net and others to be down till at least November to be on the safe side. $@#!.
Thanks to No-IP.com, I have been able to open my home Dynamic IP DSL LAN to the Internet. I’ll soon have my dedicated Solaris 9 box on-line to serve pages (Solaris 8 has so far been a pain to configure…). In the meantime you can check out the fantastic pages currently served up by Mac OS X and by Solaris.
For some reason I’m having trouble FTPing to this site from home. I think it has something to do with packet checking by my host’s new Sun Solaris server on the data coming from computers behind my firewall. This may not bode well for my own Sun machine which I’ve been intending to use as a PHP/JSP/PostgreSQL staging server once I upgrade to static IP DSL.