Koozali.org: home of the SME Server

Serviio DLNA server

Offline si_blakely

  • *
  • 57
  • +0/-0
Serviio DLNA server
« on: April 25, 2012, 02:24:34 PM »
Serviio (http://serviio.org) is a DLNA server, allowing you to share media (Photos, Audio and Video) files to compatible devices. Serviio has a wide range of DLNA Profile support, including many TVs, Disc Players, PS3 and XBox360. It also allows transcoding and container changing.

It is written in Java - I have used Iced-Tea from rpmforge. It works just as well with Sun Java. ffmpeg and mencoder are installed for transcoding.

Make a serviio ibay - this creates a serviio user and somewhere for the web-based console.

Set it for local internet access only, allow executable content
Code: [Select]
wget https://github.com/downloads/mpemberton5/Web-UI-for-Serviio/WebUI%20v1.0.zip
unzip "WebUI v1.0.zip"
cp -Rf serviioweb/* /home/e-smith/files/ibays/serviio/html
rm -f /home/e-smith/files/ibays/serviio/html/index.html

Code: [Select]
db yum_repositories set rpmforge repository \
Name 'Dag - EL5' \
BaseURL 'http://apt.sw.be/redhat/el5/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled

signal-event yum-modify

yum install ffmpeg mplayer mencoder libdvdnav vobcopy java-1.7.0-icedtea --enablerepo=rpmforge

wget http://download.serviio.org/releases/serviio-0.6.2-linux.tar.gz
tar -xvf serviio-0.6.2-linux.tar.gz
mv serviio-0.6.2 /opt/serviio
chown -R serviio:serviio /opt/serviio/library
mkdir /opt/serviio/log
chown -R serviio:serviio /opt/serviio/log
mkdir -p /var/service/serviio
mkdir -p /var/service/serviio/log

Code: [Select]
cd /var/service/serviio

make a file run containing
Code: [Select]
#!/bin/sh

# Set up correct LANG
LANG=en_US
export LANG

SERVIIO_HOME="/opt/serviio"
export SERVIIO_HOME

# Setup the JVM
if [ "x$JAVA" = "x" ]; then
    if [ "x$JAVA_HOME" != "x" ]; then
JAVA="$JAVA_HOME/bin/java"
    else
JAVA="java"
    fi
fi

# Setup the classpath
SERVIIO_CLASS_PATH="$SERVIIO_HOME/lib/*:$SERVIIO_HOME/config"

# Setup Serviio specific properties
JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=$SERVIIO_HOME/library -Dserviio.home=$SERVIIO_HOME"

exec 2>&1
# Execute the JVM in the foreground
exec setuidgid serviio "$JAVA" -Xmx384M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"         

Code: [Select]
cd /var/service/serviio/log

make a file run containing
Code: [Select]
#!/bin/sh
exec                                    \
    /usr/local/bin/setuidgid smelog     \
    /usr/local/bin/multilog t s5000000  \
    /var/log/serviio

Code: [Select]
mkdir -p /var/log/serviio
touch /var/service/serviio/down
db configuration set serviio service status enabled TCPPort 8895 UDPPort 1900 access private
ln -s /var/service/serviio /service/serviio
ln -s /etc/rc.d/init.d/daemontools /etc/rc.d/init.d/supervise/serviio
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S98serviio
chmod 755 /var/service/serviio/run
chmod 755 /var/service/serviio/log/run
chown smelog:smelog /var/log/serviio
chmod a+rw /var/log/serviio

edit /opt/serviio/config/logj4.xml and change the logfile location
Code: [Select]
<param name="File" value="/var/log/serviio/serviio.log" />
Make a masq template fragment to allow multicast on the internal interface
Code: [Select]
mkdir /etc/e-smith/templates-custom/etc
mkdir /etc/e-smith/templates-custom/etc/rc.d
mkdir /etc/e-smith/templates-custom/etc/rc.d/init.d
mkdir /etc/e-smith/templates-custom/etc/rc.d/init.d/masq
touch 39AddMulticastRoute
touch 40DenyMulticast

edit 39AddMulticastRoute to contain
Code: [Select]
# add a multicast route on the internal interface for DLNA
    /sbin/route add -net 239.0.0.0 netmask 255.0.0.0 $INTERNALIF

edit 40DenyMulticast and insert
Code: [Select]
    # Drop all multicast traffic. Note that anything on from a local network
    # will have already been accepted via the local_chk chain.
    /sbin/iptables --append INPUT -s 224.0.0.0/4    -j denylog
    /sbin/iptables --append INPUT -d 224.0.0.0/4    -j denylog
   
{
    $OUT .= "    /sbin/iptables --append OUTPUT -s 224.0.0.0/4 -d $LocalIP  -j ACCEPT\n";
    $OUT .= "    /sbin/iptables --append OUTPUT -d 224.0.0.0/4 -s $LocalIP  -j ACCEPT\n";
}
    /sbin/iptables --append OUTPUT -s 224.0.0.0/4 -d $OUTERNET  -j denylog
    /sbin/iptables --append OUTPUT -d 224.0.0.0/4 -s $OUTERNET -j denylog

Expand the template, and restart services
Code: [Select]
expand-template /etc/rc.d/init.d/masq
service masq restart
service serviio start

You can now browse to http://Server/serviio to complete configuration.

Content directories you add must be readable by the Serviio user. Ibays readable by everyone are ok. I have used the SharedFolders (http://http://wiki.contribs.org/SharedFolders)contrib for some media, so I had to set those to ManualPermissions and added a read ACL for serviio.

Have fun


Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: Serviio DLNA server
« Reply #1 on: April 30, 2012, 03:57:32 AM »
Really nice!
I'm almost done getting it to run, but still a few problems left.
There's a openbasedir on /tmp which can fixed with:
Code: [Select]
db accounts setprop serviio PHPBaseDir /home/e-smith/files/ibays/serviio/html/:/tmp
Also there's this error, which does not allow me to enter online sources:
Code: [Select]
Apr 29 22:47:12 sme8 httpd: PHP Warning:  scandir() [<a href='function.scandir'>function.scandir</a>]: (errno 13): Permission denied in /home/e-smith/files/ibays/serviio/html/tree/jquery_folder_tree/jquery.foldertree.php on line 40Any hints on how to fix it?

Thanks,

Offline si_blakely

  • *
  • 57
  • +0/-0
Re: Serviio DLNA server
« Reply #2 on: April 30, 2012, 08:58:49 AM »
Franco,

I had only used the WebUI to add folders and start/stop the services. Having just tried to set the Presentation options and add online feeds, I discovered that that did not work too well, either. It has been a bit disappointing from that point of view, and ServiiDroid (an Android management client) has been much better.

I may have a crack at the Java html interface - I still want all the web management capability. I just want it to work with a minimum of hassle.

Simon

Offline gajol

  • *
  • 23
  • +0/-0
Re: Serviio DLNA server
« Reply #3 on: October 08, 2012, 11:41:28 PM »
hi,

thx for the how to. i have this problem: i've got in the web interface:

WARNING: There is a version mismatch between Serviio and Web UI. There may be a loss of functionality.

In About no Serviio Version is shown ; WebUi Vers. 1.0

I updated the WebUI to 1.2 - The Error Message now wasn't shown, but every input in the webinterface show a "parsererror"

I found this some workarounds at the web, but nothing worked for me.

What could the problem?

Offline si_blakely

  • *
  • 57
  • +0/-0
Re: Serviio DLNA server
« Reply #4 on: October 09, 2012, 10:19:57 AM »
I have not tried the latest PHP web-UI - I started using ServiiDroid - an Android app that controls serviio.

Sorry I cannot help

Simon

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #5 on: October 12, 2012, 01:21:53 PM »
1) Many thanks to si_blakely for your guide; maybe you could transform it in "Howto" ?
2) I suspect that chown -R serviio:serviio /opt/serviio/config is necessary too.
3) Investigating php error posted by Franco; I'm using Serviio 1.0.1; I'll post futher news.
4) UI: I've installed with succes the Ajax UI from http://kairoh.bitbucket.org/serviio-webui/: you can start it simply by putting an entry in /etc/rc.local (Installation instruction inside the .tar file)
5) UI: the php ui (1.2) seems having problem (at least on SME): I was not able to browse folders nor save Presentation Settings (while I was able with (4) ).
6) At the present time I've tested only on VLC client waiting to test on Sony Bravia TV and/or LG SmartTv.
 
Bye
 
Nicola
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Serviio DLNA server
« Reply #6 on: October 12, 2012, 04:49:51 PM »
I have created an Howto about this... but I do not follow it (:$) so I'm not sure if it's working.
I'm unable to do this right now...could someone else try it and report:

http://wiki.contribs.org/Serviio

Any tips and fixes can be done directly on Wiki or report here and I'll try to make them quickly (I'm off town in training for next days!)
...

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #7 on: October 12, 2012, 06:30:26 PM »
I'm currently testing; I'll add other tips if necessary.
 
Nicola
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #8 on: October 19, 2012, 08:26:05 AM »
At the present time (19/10/2012) the working solution is Serviio 1.0.1 with Ajax UI 0.6.2-f from http://kairoh.bitbucket.org/serviio-webui -> https://bitbucket.org/kairoh/serviio-webui/wiki/History
 
Bye
 
Nicola
 
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

Offline si_blakely

  • *
  • 57
  • +0/-0
Re: Serviio DLNA server
« Reply #9 on: October 22, 2012, 11:53:59 AM »
Thanks for that, Jader - I had intended to turn this into a How-To, but wanted some more feedback before doing so.

I try to write some notes on the Ajax UI 0.6.2-f

Si

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #10 on: October 22, 2012, 12:00:58 PM »
Pay attention: the developer has released a new release of Java-Ajax Web-Ui (1.0.1-a) but i've found it not working (Unable to add folders; error saving preferences).
I'll try to contact the developer to post a bug on his site.
The Webui is simply configured by putting 2 jar files in the plugins folder of Servio and two sh script in the bin folder.
The autostart must be investigated.
 
Nicola
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

Offline gajol

  • *
  • 23
  • +0/-0
Re: Serviio DLNA server
« Reply #11 on: December 12, 2012, 02:34:19 PM »
hi,

i can´t get it to install serviio correct. Maybe you know help.

i use:
serviio 1.0.1 - http://download.serviio.org/releases/serviio-1.0.1-linux.tar.gz
servio web ui 1.0.1 - https://github.com/downloads/mpemberton5/Web-UI-for-Serviio/WebUI%20v1.0.1.zip
ajax web ui 0.6.2-f - http://kairoh.bitbucket.org/serviio-webui/dist/serviio-webui-unix-0.6.2-f.tar.gz
java-1.6.0-openjdk-1.6.0.0-1.28.1.10.10.el5_8.x86_64 already installed and latest version


on sme 8 with all current updates in 64 bit.

If i install the serviio like the howto, the server runs and i can see it from other devices. but the webui dont work. and i can´t make my preferences. i got a lot of php error in the messages:

Code: [Select]
Dec 12 10:46:18 sme8 esmith::event[3512]: Processing event: local 
Dec 12 10:46:18 sme8 esmith::event[3512]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Dec 12 10:46:18 sme8 esmith::event[3512]: expanding /etc/sysconfig/kernel 
Dec 12 10:46:19 sme8 esmith::event[3512]: expanding /boot/grub/grub.conf 
Dec 12 10:46:19 sme8 esmith::event[3512]: generic_template_expand=action|Event|local|Action|generic_template_expand|Start|1355305578 848921|End|1355305579 907289|Elapsed|1.058368
Dec 12 10:46:19 sme8 esmith::event[3512]: Running event handler: /etc/e-smith/events/local/S50clear-pptp-interfaces
Dec 12 10:46:19 sme8 esmith::event[3512]: S50clear-pptp-interfaces=action|Event|local|Action|S50clear-pptp-interfaces|Start|1355305579 907670|End|1355305579 977130|Elapsed|0.06946
Dec 12 10:46:19 sme8 esmith::event[3512]: Running event handler: /etc/e-smith/events/actions/adjust-services
Dec 12 10:46:20 sme8 esmith::event[3512]: adjusting supervised yum (once) 
Dec 12 10:46:20 sme8 esmith::event[3512]: adjust-services=action|Event|local|Action|adjust-services|Start|1355305579 977499|End|1355305580 101767|Elapsed|0.124268
Dec 12 10:54:23 sme8 httpd: PHP Fatal error:  Unsupported operand types in /home/e-smith/files/ibays/serviio/html/lib/serviio.php on line 88
Dec 12 10:54:23 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/status.php on line 37
Dec 12 10:54:23 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/status.php on line 64
Dec 12 10:54:28 sme8 httpd: PHP Fatal error:  Unsupported operand types in /home/e-smith/files/ibays/serviio/html/lib/serviio.php on line 88
Dec 12 10:54:33 sme8 httpd: PHP Fatal error:  Unsupported operand types in /home/e-smith/files/ibays/serviio/html/lib/serviio.php on line 88
Dec 12 10:54:36 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/presentation.php on line 10
Dec 12 10:54:36 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/presentation.php on line 53
Dec 12 10:54:37 sme8 httpd: PHP Warning:  file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/e-smith/files/ibays/serviio/html/:/tmp) in /home/e-smith/files/ibays/serviio/html/tree/jquery_folder_tree/jquery.foldertree.php on line 18
Dec 12 10:54:38 sme8 httpd: PHP Fatal error:  Unsupported operand types in /home/e-smith/files/ibays/serviio/html/lib/serviio.php on line 88
Dec 12 10:54:38 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/metadata.php on line 27
Dec 12 10:54:38 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/metadata.php on line 37
Dec 12 10:54:38 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/library.php on line 28
Dec 12 10:54:38 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/library.php on line 75
Dec 12 10:54:38 sme8 httpd: PHP Warning:  file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/e-smith/files/ibays/serviio/html/:/tmp) in /home/e-smith/files/ibays/serviio/html/tree/jquery_folder_tree/jquery.foldertree.php on line 18
Dec 12 10:54:39 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/status.php on line 37
Dec 12 10:54:39 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/view/status.php on line 64
Dec 12 10:54:43 sme8 httpd: PHP Fatal error:  Unsupported operand types in /home/e-smith/files/ibays/serviio/html/lib/serviio.php on line 88
Dec 12 10:55:18 sme8 last message repeated 7 times
Dec 12 10:56:23 sme8 last message repeated 13 times
Dec 12 10:57:28 sme8 last message repeated 13 times
Dec 12 10:57:34 sme8 httpd: PHP Warning:  Invalid argument supplied for foreach() in /home/e-smith/files/ibays/serviio/html/lib/serviio.php on line 73
Dec 12 10:58:26 sme8 httpd: PHP Warning:  file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/e-smith/files/ibays/serviio/html/:/tmp) in /home/e-smith/files/ibays/serviio/html/tree/jquery_folder_tree/jquery.foldertree.php on line 18
Dec 12 10:59:55 sme8 httpd: PHP Fatal error:  Unsupported operand types in /home/e-smith/files/ibays/serviio/html/lib/serviio.php on line 88
Dec 12 11:00:30 sme8 last message repeated 7 times
Dec 12 11:01:16 sme8 last message repeated 8 times

if i start the the "serviio-wrapper.sh" the webui works i can save my preferences. media files are added and i´ve got an status server running. BUT i can´t see the server on my devices.

if i start regular the script stops, i didn´t come back to the console, but the webui works.

with
Code: [Select]
bash -vf serviio-wrapper.sh i got an error an the script stops:

Code: [Select]
bash -vf /opt/serviio/bin/serviio-wrapper.sh
#!/bin/sh
### ======================================================================
##
##  Serviio WebUI start Script.
##
### ======================================================================
DIRNAME=`dirname $0`
dirname $0
PROGNAME=`basename $0`
basename $0

# OS specific support (must be 'true' or 'false').
cygwin=false; darwin=false; linux=false;
case "`uname`" in
    CYGWIN*) cygwin=false ;;
    Darwin*) darwin=false ;;
    Linux)   linux=true ;;
esac
uname

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
    [ -n "$SERVIIO_HOME" ] &&
        SERVIIO_HOME=`cygpath --unix "$SERVIIO_HOME"`
    [ -n "$JAVA_HOME" ] &&
        JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Setup SERVIIO_HOME
if [ "x$SERVIIO_HOME" = "x" ]; then
    # get the full path (without any relative bits)
    SERVIIO_HOME=`cd $DIRNAME/..; pwd`
fi
cd $DIRNAME/..; pwd
export SERVIIO_HOME

# Setup the JVM
if [ "x$JAVA" = "x" ]; then
    if [ "x$JAVA_HOME" != "x" ]; then
     JAVA="$JAVA_HOME/bin/java"
    else
     JAVA="java"
    fi
fi

# Setup the classpath
SERVIIO_CLASSPATH="$SERVIIO_HOME/config"
LIB=${SERVIIO_HOME}/plugins
for jar in `ls -1 ${LIB}/*.jar`; do SERVIIO_CLASSPATH="${SERVIIO_CLASSPATH}:${ja                                                                                                                                                             r}"; done
ls -1 ${LIB}/*.jar
ls: /opt/serviio/plugins/*.jar: Datei oder Verzeichnis nicht gefunden
LIB=${SERVIIO_HOME}/lib
for jar in `ls -1 ${LIB}/*.jar`; do SERVIIO_CLASSPATH="${SERVIIO_CLASSPATH}:${ja                                                                                                                                                             r}"; done
ls -1 ${LIB}/*.jar
ls: /opt/serviio/lib/*.jar: Datei oder Verzeichnis nicht gefunden

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
    SERVIIO_HOME=`cygpath --path --windows "$SERVIIO_HOME"`
    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
    SERVIIO_CLASSPATH=`cygpath --path --windows "$SERVIIO_CLASSPATH"`
fi

# Find best max heap size (from Patters' http://pcloadletter.co.uk/2012/01/25/se                                                                                                                                                             rviio-syno-package/)
JAVA_MAX_HEAP=384M
RAM=$(grep "MemTotal" /proc/meminfo | awk '{print $2/1024}')
grep "MemTotal" /proc/meminfo | awk '{print $2/1024}'
if [ $RAM -le 128 ]; then
    JAVA_MAX_HEAP=80M
elif [ $RAM -le 256 ]; then
    JAVA_MAX_HEAP=192M
fi
/opt/serviio/bin/serviio-wrapper.sh: line 59: [: 2009,33: integer expression exp                                                                                                                                                             ected
/opt/serviio/bin/serviio-wrapper.sh: line 61: [: 2009,33: integer expression exp                                                                                                                                                             ected

# Execute the JVM in the foreground
JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dfile.encod                                                                                                                                                             ing=UTF-8 -Dserviio.home=$SERVIIO_HOME -Dderby.system.home=$SERVIIO_HOME/library                                                                                                                                                             "
JVM_OPTS="-Xms20M -Xmx${JAVA_MAX_HEAP} -XX:+UseParNewGC -XX:MinHeapFreeRatio=10                                                                                                                                                              -XX:MaxHeapFreeRatio=20"
"$JAVA" $JVM_OPTS $JAVA_OPTS -classpath "$SERVIIO_CLASSPATH" org.serviio.restui.                                                                                                                                                             ServiioWrapper "$@"
Exception in thread "main" java.lang.NoClassDefFoundError: org/serviio/restui/Se                                                                                                                                                             rviioWrapper
Caused by: java.lang.ClassNotFoundException: org.serviio.restui.ServiioWrapper
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.serviio.restui.ServiioWrapper. Program will e                                                                                                                                                             xit.

wich things have to be changed from the howto by using the ajax webUI?
ps: i don´t have an android phone, then i need the webinterface.

thank you very much.


Offline go_jesse

  • *
  • 2
  • +0/-0
Re: Serviio DLNA server
« Reply #12 on: January 03, 2013, 04:27:32 AM »
the howto worked great for me. Thanks!!!

As a followup, I upgraded to 1.1 servio and it works fine with original webui (but complains about mismatch)

I am investigating webui update.

Offline WayneJVM

  • *
  • 22
  • +0/-0
Re: Serviio DLNA server
« Reply #13 on: January 27, 2013, 01:24:50 AM »
I have tried upgrading to 1.1 and found that my DLNA players would no longer work and neither would the Flowplayer. Was there anything different about the install?

Offline Drifting

  • ****
  • 431
  • +0/-0
Re: Serviio DLNA server
« Reply #14 on: February 11, 2013, 11:58:01 AM »
I feel all rather confused by this installation.

I have followed the howto, but have the porblems discussed in the forum with parser and missmatch in the webui. So what versions do I need to get this working? The link at the bottom of the forum tread just goes to the webui version.

Regards P
Infamy, Infamy, they all have it in for me!

Offline si_blakely

  • *
  • 57
  • +0/-0
Re: Serviio DLNA server
« Reply #15 on: February 12, 2013, 12:43:34 PM »
I have Serviio 1.1 with Ajax WebUI 1.0.1-c.

Java version is 1.6.0_31
The Webui jar files are in the /opt/serviio/plugins folder.

I have set up a serviio-web service

Code: [Select]
mkdir -p /var/service/serviio-web
mkdir -p /var/service/serviio-web/log

Code: [Select]
cd /var/service/serviio-web/log
make a file run containing
Code: [Select]
#!/bin/sh
exec                                    \
    /usr/local/bin/setuidgid smelog     \
    /usr/local/bin/multilog t s5000000  \
    /var/log/serviio-web
Code: [Select]
cd /var/service/serviio-web
make the run file
Code: [Select]
#!/bin/sh

# Set up correct LANG
LANG=en_US
export LANG

# Setup SERVIIO_WEBUI_HOME
if [ "x$SERVIIO_WEBUI_HOME" = "x" ]; then
    # get the full path (without any relative bits)
    SERVIIO_WEBUI_HOME="/opt/serviio"
fi
export SERVIIO_WEBUI_HOME

# Setup the JVM
if [ "x$JAVA" = "x" ]; then
    if [ "x$JAVA_HOME" != "x" ]; then
JAVA="$JAVA_HOME/bin/java"
    else
JAVA="java"
    fi
fi

# Setup the classpath
WEBUI_CLASSPATH="$SERVIIO_WEBUI_HOME/config"
LIB=${SERVIIO_WEBUI_HOME}/plugins
for jar in `ls -1 ${LIB}/*.jar`; do WEBUI_CLASSPATH="${WEBUI_CLASSPATH}:${jar}"; done
LIB=${SERVIIO_WEBUI_HOME}/lib
for jar in `ls -1 ${LIB}/*.jar`; do WEBUI_CLASSPATH="${WEBUI_CLASSPATH}:${jar}"; done

# Setup Serviio specific properties
JAVA_OPTS="-Dserviio.home=$SERVIIO_WEBUI_HOME -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true"
JVM_OPTS="-Xms5M -XX:+UseParNewGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -Dfile.encoding=UTF-8"


exec 2>&1
# Execute the JVM in the foreground
exec setuidgid serviio "$JAVA" $JVM_OPTS $JAVA_OPTS -classpath "$WEBUI_CLASSPATH" org.serviio.restui.RestletProxy "$@"

Code: [Select]
mkdir -p /var/log/serviio-web
touch /var/service/serviio-web/down
db configuration set serviio-web service status enabled TCPPort 8123 access private
ln -s /var/service/serviio-web /service/serviio-web
ln -s /etc/rc.d/init.d/daemontools /etc/rc.d/init.d/supervise/serviio-web
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S99serviio-web
chmod 755 /var/service/serviio-web/run
chmod 755 /var/service/serviio-web/log/run
chown smelog:smelog /var/log/serviio-web
chmod a+rw /var/log/serviio-web
db accounts set serviio ProxyPass Description Serviio_WebUI Target http://localhost:8123/serviio
service serviio-web start

This allows console access from http://<server>/serviio.
I don't use the shared wrapper, as I like the two services to be independent.
Try setting this up, stop the services (use ps -ef | grep java) to check,
then start serviio first, and then serviio-web.

Good luck.

Offline Drifting

  • ****
  • 431
  • +0/-0
Re: Serviio DLNA server
« Reply #16 on: February 12, 2013, 04:02:18 PM »
Thank you so much for further information, but I have followed the Wiki post with serviio in an ibay. Perhaps the two installs can be combined into a single one that I could get to work :-) Not saying your instructions a wrong, just that I followed the other route, which has files in different locations. Wished I had installed this in a VM first.
Perhaps a definitive download list and their locations that are known to work would be usefull for those of us with less knowledge on versions could use.

Thanks again for taking the time to help.

Infamy, Infamy, they all have it in for me!

Offline si_blakely

  • *
  • 57
  • +0/-0
Re: Serviio DLNA server
« Reply #17 on: February 12, 2013, 06:22:08 PM »
When I wrote the howto, the PHP Webui was about the only solution. When I rebuilt my server to SME 8, I updated my serviio install to use the Ajax Web UI. I can't edit the wiki page to update it, but the Ajax Web UI is a better way to go.

Delete the files in serviio ibay and the ibay itself.

Use groupadd to create a system group serviio (groupadd serviio)
Use useradd to create a system account serviio (useradd -g serviio serviio).

Download the latest Ajax Web UI (http://kairoh.bitbucket.org/serviio-webui/). Unzip the files, and copy them into /opt/serviio. The 2 jar files will end up in /opt/serviio/plugins.

Follow the instructions I added above to finish the Ajax Web UI install.



Offline Drifting

  • ****
  • 431
  • +0/-0
Re: Serviio DLNA server
« Reply #18 on: February 13, 2013, 11:58:40 AM »
Dumb question probably, are you saying use the (what the site says is a windows zip file) and the Linux one? Anyway, I have done that, and have copied the jar files into the plugins, sadly now all I get from http://server-ip/serviio is a 404 error

Was following as you advised yesterdays instructions.

[root@home plugins]# service serviio-web start
Starting serviio-web:                                      [  OK  ]


[root@home plugins]# service serviio start
Starting serviio:                                          [FAILED]

Sigh, little knowledge is dangerous, and I have very little knowledge.

« Last Edit: February 13, 2013, 12:46:08 PM by Drifting »
Infamy, Infamy, they all have it in for me!

Offline si_blakely

  • *
  • 57
  • +0/-0
Re: Serviio DLNA server
« Reply #19 on: February 13, 2013, 12:44:14 PM »
You need the Unix one - my mistake for not being clear enough. However, the zip file should have the same contents in the plugins directory.

When you extract the files (.zip or tar.gz), you should get a /bin directory (containing startup scripts that are not used), a /plugins directory and two readmes.
Move the contents of the /plugins directory (2 .jar files) into the /opt/serviio/plugins directory.

Offline Drifting

  • ****
  • 431
  • +0/-0
Re: Serviio DLNA server
« Reply #20 on: February 26, 2013, 02:45:10 PM »
I know perhaps I am being a bit thick here.

But I have followed to the best of my ability your install, did however get confused as to which parts I am supposed to remove / re install etc. Or even follow for that matter.

Could I be really awkward and ask for a blow by blow on an install?

Currently Serviio will not start, and I have no web page for it either !

Regards P
Infamy, Infamy, they all have it in for me!

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Serviio DLNA server
« Reply #21 on: February 27, 2013, 11:43:20 AM »
When I wrote the howto, the PHP Webui was about the only solution. When I rebuilt my server to SME 8, I updated my serviio install to use the Ajax Web UI. I can't edit the wiki page to update it, but the Ajax Web UI is a better way to go.

Hi

I'm part of documentation team and would like to help you to update wiki.
Could you get the wiki content, update it on your computer using NOTEPAD or any text editor and send it to me directly jader.marasca @ gmail   or post here ?
You just need to post/send the changed parts... not all page ;)
I'll format and update wiki to everyone benefit!

Thanks

Jáder
...

Offline Knuddi

  • *
  • 540
  • +0/-0
    • http://www.scanmailx.com
Re: Serviio DLNA server
« Reply #22 on: March 05, 2013, 10:42:28 PM »
Dear all,

I have used minidlna (the dlna used in NetGear boxes) on both a SME 7 and 8 box and its super easy and runs on static libraries. Its works perfectly with my iPad and my Samsung LED.

http://sourceforge.net/projects/minidlna/files/minidlna/1.0.25/minidlna_1.0.25_static.tar.gz/download

/Jesper

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #23 on: August 14, 2014, 11:58:10 AM »
----> Knuddy

With latest upgrades (both by Serviio & Sme) I've not been able to have Serviio working at least as service (it seems Java processes interfering with both boot & shutdown), so I gave a chance to Minidlna and it was really a beatiful surprise.
Simple and static.
Did you make some tweak to manage it like a service or simply you put in autostart without further configurations (that, at a glance, it seems enough) ?

Nicola
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

guest22

Re: Serviio DLNA server
« Reply #24 on: August 14, 2014, 02:21:47 PM »
Nicola,

any chance you can draft up a wiki page about your efforts please?

Thanks,
guest

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #25 on: August 14, 2014, 05:54:32 PM »
The "failed one" with Serviio 1.4.x and Sme 8.1 or the "working one" with Minidlna ?
If the second one I'm still testing . . .

Nicola
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

guest22

Re: Serviio DLNA server
« Reply #26 on: August 15, 2014, 10:27:05 PM »
Both please, but especially the one that really works ;-)

Thanks,
guest

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #27 on: August 19, 2014, 03:18:10 PM »
Mindlna (now ReadyMedia) working like a daemon not like a real service (on Sme 8.1/32 with Hp Microserver NL36 with 2x2TB raid 1 on WD Black hdds).
First of all: the test may be affected by the former presence of Servviio, so is welcomed who can test on a "fresh SME".
This is a rough explanation of what I did that is not necessarily the best.
The Minidlna (now ReadyMedia) binary is available at SourceForge: the last (at august 19 2014) is 1.1.3.
http://sourceforge.net/projects/minidlna/files/minidlna/1.1.3/
Downloading the "static" version you get all media library compiled into the binary (so no need to install flac,libogg,libid3tag,libexif,sqlite,ffmpeg,libvorbis,libjpeg).
Once installed:
Quote
tar xzf minidlna_1.1.3_static.tar.gz -C /
the binary (minidlnad) is in /usr/sbin while conf is in /etc/minidlna.conf; the conf file is well commented so you can easily configure minidlnad (cache and log location, media folders ecc.). This is my conf (media files in ibays):

Quote
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200

# network interfaces to serve, comma delimited
# network_interface=eth0

# specify the user account name or uid to run as
user=root

# set this to the directory you want scanned.
# * if you want multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to specific content types, you
#   can prepend the types, followed by a comma, to the directory:
#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
#   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
media_dir=A,/home/e-smith/files/ibays/musica/files
media_dir=V,/home/e-smith/files/ibays/film/files
media_dir=P,/home/e-smith/files/ibays/fotografie/files

# set this to merge all media_dir base contents into the root container
# note: the default is no
#merge_media_dirs=no

# set this if you want to customize the name that shows up on your clients
friendly_name=Mazzone DLNA Server

# set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
db_dir=/opt/minidlna

# set this if you would like to specify the directory where you want MiniDLNA to store its log file
log_dir=/var/log/minidlna

# set this to change the verbosity of the information that is logged
# each section can use a different level: off, fatal, error, warn, info, or debug
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn

# this should be a list of file names to check for when searching for album art
# note: names should be delimited with a forward slash ("/")
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg

# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=yes

# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
enable_tivo=no

# set this to strictly adhere to DLNA standards.
# * This will allow server-side downscaling of very large JPEG images,
#   which may hurt JPEG serving performance on (at least) Sony DLNA products.
strict_dlna=no

# default presentation url is http address on port 80
#presentation_url=http://www.mylan/index.php

# notify interval in seconds. default is 895 seconds.
notify_interval=900

# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1

# specify the path to the MiniSSDPd socket
#minissdpdsocket=/var/run/minissdpd.sock

# use different container as root of the tree
# possible values:
#   + "." - use standard container (this is the default)
#   + "B" - "Browse Directory"
#   + "M" - "Music"
#   + "V" - "Video"
#   + "P" - "Pictures"
#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
#root_container=.

# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title

# maximum number of simultaneous connections
# note: many clients open several simultaneous connections while streaming
#max_connections=50
The daemon is run as root
Then I made some db additions:
Quote
db configuration set minidlnad service
db configuration setprop minidlnad TCPPort 8200
db configuration setprop minidlnad UDPPort 1900
db configuration setprop minidlnad TCPPort 1900
signal-event remoteaccess-update
manually started with  /usr/sbin/minidnad works fine
to have it in autostart I put it in /etc/rc.d/init.d/local
Quote
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/sbin/minidlnad

I tested only with WMP12 and VLC 2.0.8 (this seems the last release working with uPnP, latest releases all crashing), no SmartTV, with success (some problem with some file MP3 not scanned or video not reproducing but they seem problems you can experience with Qnap or Netgear boxes or other DLNAs too, due to bad file encoding).
I'm not able to say if all the "multicast" config done for Serviio is necessaryfor Minidna too: on this system, previously using Serviio, multicast settings is still existing.

Some people on Centos 6 can set it up as service: http://blog.irq1.com/install-minidlna-centos/ . I've not been able to do this with Sme.

Nicola
« Last Edit: August 19, 2014, 10:05:49 PM by nicolatiana »
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Serviio DLNA server
« Reply #28 on: August 19, 2014, 03:46:47 PM »
Serviio not working: I tried to upgrade Serviio, together with Sme pushed from a 8 to 8.1 (32). The current version of serviio is serviio-1.4.1.2-linux.tar.gz.
I followed the wiki how-to to perform a fresh install of Serviio with the following results:

the service start generates lots of Java processes coming from this command:
Quote
# Execute the JVM in the foreground
"$JAVA" -Xmx512M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"
this cause a console "hang" after the message "Starting Serviio OK"; the server is not inconsistent: you can connect to another console with Alt+F2 or putty and killing some Java processes the boot completes (on console);

the same java processes seem to prevent a clean shutdown of the server that hangs indefinitely after the "killall" message.
stopping manually serviio service and killing with a "machete" all of the java processes the system can shutdown in a clean way.

I tried to replace standard java package with Oracle java: no joy.

Apart this "small" issues  :-? the server worked fine, except the Webui that still does not allow to browse filesystem to select media folder (ajax console was still the working tool to select folders).

I abandoned and passed to MinDlna because I had to return back the server to the customer and I had few time to attempt further solutions.

Nicola

Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.