iTunes Server

13 07 2008

Hệ điều hành dùng làm iTunes Server: centOS 5

Máy sử dụng truy cập (clients): Mac 0S X on PC (x86), Windows Vista

1. Download các gói cần thiết :

mt-daapd —> http://sf.net/projects/mt-daapd/

Nếu bạn nghe các bài hát tiếng Nhật thì cần phải xử lý thêm bằng cách dùng gói patch mt-daapd-0.2.4.xxx.patch —> http://www.kzsoft.to/~kazu/mt-daapd/

2. Install

2.1 Nếu đã cài gcc thì có thể bỏ qua bước này:

#yum -y install gcc

2.2 Cài đặt các thư viện cần thiết

#yum install libid3tag libid3tag-devel zlib-devel gdbm-devel

2.3 Giải nén và patch

$tar xzvf mt-daapd-0.2.4.xxx.tar.gz

$cd mt-daapd-0.2.4.xxx

$patch -p1 -F 3 < ../mt-daapd-0.2.4.xxx.patch

2.4 Cài đặt

$./configure

$make

#make install

3. Tạo thư mục để nhạc

#mkdir /var/mt-daapd (tên thư mục tùy thích)

#cp contrib/mt-daapd.conf /etc  (nhớ là các bước này bạn vẫn đang ở trong thư mục mt-daapd-0.2.4.xxx)

4. Biên tập file setting

#vi /etc/mt-daapd.conf

sửa các chỗ sau:

web_root    /usr/local/share/mt-daapd/admin-root

mp3_dir     /var/mt-daapd

servername   iTunes Server

extensions   .mp3, .m4a, .m4p, .m4v

5. Copy scripts khởi động

#cp contrib/mt-daapd /etc/rc.d/init.d

#vi /etc/rc.d/init.d/mt-daapd

sửa đoạn sau:

daemon /usr/local/sbin/mt-daapd

6. Mở firewall

Mở cổng 3689

#/sbin/iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 3689 -j ACCEPT

#/etc/rc.d/init.d/iptables save

7. Khởi động server

#/etc/rc.d/init.d/mt-daapd start

#chkconfig mt-daapd on

Chú ý: khi bạn khởi động server và bị báo lỗi sau:

/usr/local/sbin/mt-daapd: error while loading shared libraries: libid3tag.so.0: cannot open shared object file: No such file or directory

Bạn mở file /etc/ld.so.conf mà thêm vào dòng /usr/local/lib và thực thi lệnh ldconfig là ok.

Làm như sau:

#vi /etc/ld.so.conf

thêm dòng: /usr/local/lib

#ldconfig

Tham khảo thêm:

http://speedmania.jp/blog/linux/2006/10/

http://egt.tpot.tk/a/2007_05.html