26 August 2007

Notes on mod_mp3 running on OpenBSD 4.1 default apache (under chroot)

The default Apache instance on OpenBSD runs as chroot (8) in /var/www. This creates problems when trying to run mod_mp3, which needs binary modules outside the chrooted environment. To fix it:

mkdir -p /var/www/usr/local/lib /var/www/usr/local/sbin
cp /usr/local/libmod_mp3.so /var/www/usr/local/lib/
cp /usr/local/sbin/mod_mp3-enable /var/www/usr/local/sbin/ 
(not sure if mod_mp3-enable is really required, but wth)

Also consider that the directories containing MP3s must be reachable by the chrooted environment with the same path as in the original environment. So for example you want to do something like this:

mkdir /var/www/music
mkdir -p /var/www/var/www
cd /var/www/var/www
ln -s /var/www/music music
and then in /var/www/conf/mp3.conf you'll specify the directory as /var/www/music.

(And after figuring this out, I've found that I'm screwed anyway, because I'm storing the MP3 files on a different disk, which by design is not reachable inside the chrooted environment. Either I move the entire chrooted environment on that disc, or I stop worrying and learn to love samba shares.)

Technorati Tags: , , ,

No comments: