Successfully tested on Ubuntu Server 12.04 LTS 64-bit

Having a home server to centralize and share documents over your network, publish websites or run your own mail server is pretty cool in fact, but today is time to have more fun with your computer rig. Let’s talk about multimedia sharing, streaming and transcoding with the installation of a DLNA server: Serviio.

First of all, head to Serviio website, look for the link to the latest archive for Linux and download it:

wget link_to_latest_serviio_archive

 
Create the /opt/serviio directory and unpack the file to it:

mkdir -p /opt/serviio && tar -C /opt/serviio -xvzf serviio_archive.tar.gz --strip-components=1

 
Then, create a serviio system user:

adduser --system --home /opt/serviio serviio

 
and assign the installation folder ownership to him:

chown serviio:nogroup -R /opt/serviio

 
Create another specific folder which will be used by Serviio to temporarily store the transcoded files (choose the path you prefer but make sure it points to a partition with sufficient free space as multimedia files can be huge):

mkdir /media/md0/.tmp

 
change its access permissions:

chmod 1777 /media/md0/.tmp

 
and then modify the /opt/serviio/bin/serviio.sh script to point to this folder by adding the following parameter at the end of the JAVA_OPTS= line:

-Dserviio.defaultTranscodeFolder=/media/md0/.tmp

 
Now, install all the third party applications needed to have a fully working Serviio: First, install Java if it’s not already installed:

apt-get install default-jre

 
Then, build and install FFmpeg according to the instructions you’ll find in Serviio and FFmpeg Wikis (FFmpeg Wiki contains useful specific instructions dedicated to server/headless machines).

Finally, install dcraw if you need RAW images support:

apt-get install dcraw

 
We’re close to the end now. Let’s just make sure the DLNA server will be launched at startup. To do this, simply create an init script /etc/init/serviio.conf with the following content:

# Serviio - Media Streaming Server
#
# Serviio is a free media server. It allows you to stream your media files
# (music, video or images) to renderer devices (e.g. a TV set, Bluray
# player, games console or mobile phone) on your connected home network.

description "Serviio - Media Streaming Server"

env USER=serviio
env LANG=fr_FR.UTF-8

start on started networking
start on mounted DEVICE=[/UL]*
stop on shutdown

respawn

exec start-stop-daemon --start --make-pidfile --pidfile /var/run/serviio.pid -c $USER --exec /opt/serviio/bin/serviio.sh

(the LANG setting is optional and can be used to define a specific locale)

You can now start the DLNA server (also stop or restart) using the service command:

service serviio start

 
As everything went fine (of course!), you should soon see the server on any UPnP/DLNA device connected to the same subnet. If not, look for suspicious entries in /opt/serviio/log/serviio.log. If you need a more verbose log, modify the org.serviio category as follows in /opt/serviio/config/log4j.xml:

<category name="org.serviio">
   <priority value="DEBUG"/>
</category>

 
and restart Serviio. Now, you should have some clues to help you solve the problem.

One last useful tip: Unfortunately, Serviio lacks a web console in our headless setup. You can find some, proposed by users on Serviio forum, but the easiest solution, for now, is still to install the console on a local Windows client to remotely manage your server settings. Before launching this console, make sure to edit the C:\Program Files\Serviio\bin\ServiioConsole.exe.vmoptions file on the client, add the following line:

-Dserviio.remoteHost=serviio_server_ip_address

 
and everything should be fine.

That’s all Folks!


For further reading, see Serviio very informative wiki and forum.

About these ads