Contents

Overview

I have been using Apache2 with mod_musicindex to provide streaming audio to the various computers around my house and to enable me to access my music collection from work (my ADSL is confiured with static IP and did port forwarding to my laptop). On aquisition of my nice shiny new Linkstation2 it seemed only obvious that I move this functionality to the Linkstation so that I don't have to leave my laptop on all day when I am at work.

Apache Build

Pre-Requisites

Linkstation2

mipsel-openlink-052b.zip (from the downloads section and installed as per README).

mipsel-tools-2.tgz (from the downloads section and inststalled with the install.sh).

mipsel-screen-1.tgz (from the downloads section and inststalled with the install.sh). (NOT REQUIRED but the compile takes ages and this helps if you get disconnected when it is running).

/usr/bin/sort extracted from the debian package coreutils-5.2.1

apache source httpd-2.0.55.tar.gz

This is now enough to compile apache2

Procedure

( I enable ssl to help bypassing content filters at work. I have also enabled proxy which allows me to proxy to internal server resources if they are available (like my laptop running tomcat and some of my development work))

Extract httpd-2.0.55.tar.gz

cd httpd-2.0.55

./configure --prefix=/mnt/hda/apache --enable-ssl --enable-proxy

make

make install

WAIT AGES

create an apache user and group in /etc/passwd and /etc/group respectively with the users home set to /mnt/hda/apache

cd ~apache/conf

edit httpd.conf to set ServerName to something appropriate set the User and Group directives to apache

edit /etc/thttpd.conf and change the port to 8080 (I did this to make my life easier accessing the apache instance and also to hide the config interface from the net when I set port forwarding to the linkstation)

run /etc/init.d/thttpd restart

Start apache (cd ~apache/bin; ./apachectl start)

Go to http:/<linkstation>/ and see the apache page.

Create a start script in /etc/init.d (included below)

cd /etc/rc.d/rc2.d

ln -s ../init.d/apache S95apache

cd /etc/rc.d/rc0.d

ln -s ../init.d/apache K05apache

cd /etc/rc.d/rc6.d

ln -s ../init.d/apache K05apache

That should be a nice little apache2 install which will restart every reboot now.

Build mod_musicindex

Pre-Requisites

Required Libraries

I only wanted vorbis and mp3 support so this is all I have used. If you figure out all the dependencies for other codecs feel free to add them. The libraries were downloaded from my local debian mirror and I used alien -t <debfile> to convert them to tgz files which were extracted into the root of the link station.

* libid3tag0-0.15.1b.tgz

* libid3tag0-dev-0.15.1b.tgz

* libmad0-0.15.1b.tgz

* libmad0-dev-0.15.1b.tgz

* libogg0-1.1.3.tgz

* libogg-dev-1.1.3.tgz

* libvorbis0a-1.1.2.tgz

* libvorbis-dev-1.1.2.tgz

* libvorbisenc2-1.1.2.tgz

* libvorbisfile3-1.1.2.tgz

Procedure

Extract libapache-mod-musicindex_1.0.2.orig.tar.gz

cd libapache-mod-musicindex-1.0.2

./configure --with-apxs=/mnt/hda/apache/bin/apxs

make

make install

Add LoadModule musicindex_module modules/mod_musicindex.so near the top of ~apache/conf/httpd.conf

Add a Directory config for music index to the bottom of ~apache/conf/httpd.conf (see mine below).

Create a directory ~apache/musicindex and do chmod 0777 ~apache/musicindex (this will be used to cache stuff so I didn't want it on the root filesystem).

Create a directory ~apache/htdocs/musicindex and copy the contents of /usr/local/share/mod_musicindex/ into it.

The home_backup was created from my laptop running Ubuntu after I installed rsync on to the link station. This allows me to regularly back up my laptop and rsync will only copy deltas which saves me loads of time.