I’ve have finally started to move again some services in my LAN away from Windows onto Ubuntu servers. This time is Subsonic’s turn so I decided to write this guide to keep track of my own work and bring some content to unlockforus.com in the process. Ubuntu Server installation is out of the scope of this guide but honestly, even a caveman could get a Ubuntu server instance up and running in less than 5 minutes.
Installing Subsonic Media Streamer
Login into your ubuntu server box and let’s get it done.
First, install Java:
sudo apt-get install openjdk-6-jre
Next download subsonic-4.6.deb package
Install subsonic-4.6.deb package
sudo dpkg -i subsonic-4.6.deb
At this point your Subsonic server should be installed, up and running. You can confirm this by browsing to your Ubuntu box:
http://ubuntu-box-IP:4040 or http://hostname:4040 (Please note that Subsonic will run by default in port 4040).
All good, but by default Subsonic runs as root in my Ubuntu box and I don’t really like the idea even when this machine is behind my firewalled LAN. Hence I decided to give it a shot and attempted to run my Subsonic as a non-root user. What follows here is the outcome…
First, let’s check our subsonic process:
ps -Af | grep subsonic
As you saw in the previous screenshot subsonic is running as root. mehh… let’s take care of this small inconvenience now for some peace of mind.
Move yourself as root in your Ubuntu box:
and stop subsonic service:
service subsonic stop
Let’s now create the new user that we will use to run our Subsonic service. In my guide I’ll name it subsonic.
adduser --system --no-create-home subsonic
Add subsonic user to the audio group:
adduser subsonic audio
Awesome! Moving forward I now need to change some permissions to make sure my subsonic service will run without any problems…
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 chown subsonic /etc/default/subsonic chmod 754 /etc/default/subsonic
With all this accomplished we will now edit our subsonic configuration to run it as the subsonic user in our next start:
Change the line SUBSONIC_USER=root to SUBSONIC_USER=subsonic
Exit out the editor saving your changes… Press “ESC” (Escape) to get out of edit-mode and then:
Move yourself out of root if you wish at this point and start your Subsonic Media Streaming Server service:
sudo service subsonic restart
… and verify that your subsonic service is now running as subsonic user:
ps -Af | grep subsonic
Login into your streaming server and start enjoying some music.
Note: I received a couple of e-mails where the transcoder will not work and the server will serve the original file instead. If you run into the same problem just recreate your lame link:
sudo mv /var/subsonic/transcode/lame /var/subsonic/transcode/lame_backup sudo ln -s /usr/bin/lame /var/subsonic/transcode/lame