I choose already for some time
subsonic as music streaming and jukebox system. This was working well with the basic installation information provided from the website:
sudo apt-get install openjdk-6-jre
sudo dpkg -i subsonic-x.x.deb
sudo apt-get install lame flac faad vorbis-tools ffmpeg
First problem: no sound in jukebox mode. The solution is to install the java from sun, and use this one instead of the openjdk provided by default.
sudo apt-get install sun-java6-jre sun-java6-plugin
Installing is only half of the job. Selecting what java to use is done with following command:
update-java-alternatives -s java-6-sun
Second problem: subsonic is now running as root. This is not a big deal when the server is intended to be use behind your firewall, but becomes a bit scary when allowing access from internet.
The solution is described in the official subsonic forum. I preferred the second post of the thread explaining how to do the changes to run as a specific user still using the simple package based installation. The first post requires to configure your own web-server, a bit more complex for similar result.
I used slightly different commands:
sudo su
service subsonic stop
adduser --system --no-create-home subsonic
adduser subsonic audio
chown -R subsonic:nogroup /tmp/subsonic
chown -R subsonic:nogroup /var/subsonic
chown -R root:root /var/subsonic/transcode
chown -R root:root /var/subsonic/jetty/*/webapp
Now we need to edit
/usr/share/subsonic/subsonic.sh to use
sudo -u subsonic
before the call to java. The line looks like that with the change applied:
sudo -u subsonic ${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
Now subsonic can be started, and we can verify it uses the correct assigned user instead of root. Start subsonic:
service subsonic start
.
ps -Af | grep subsonic
shows what user runs subsonic.
To finish, enjoy some music :)