Page 1 of 20 1234511 ... LastLast
Results 1 to 10 of 204

Thread: [HOWTO] Install Serviio in Freenas 8.0.x

Hybrid View

  1. #1
    Stefan Reek
    Guest

    [HOWTO] Install Serviio in Freenas 8.0.x

    Moderator Note: (Please read to end of thread before trying to follow this tutorial)


    I fooled around a bit to see if I could get Serviio to work on Freenas 8.0.1Beta4.
    As I noticed a lot of people asking for it, but no one that had actually managed to install it I expected it to be rather difficult, but thankfully it wasn't.

    I followed the steps as given in this thread on the serviio forums http://forum.serviio.org/viewtopic.php?f=14&t=2060
    But when I wanted to install the Diablo JRE I noticed there wasn't a FreeBSD 8.x version of it. I then read that the 7.x version could be used if the misc/compat7x port was installed.

    I haven't tried to install the JRE without this port, so I'm not quite sure if it's needed.
    But anyway, this is how you install it:

    (Make sure you are root and you have mounted your file system as read/write)
    Code:
    su
    mount -urw /
    First you'll have to get the ports by using
    Code:
    portsnap fetch -d <fetch dir>
    The ports have to be downloaded to you data disks as /var on the usb installation
    does not have enough space for it, so make sure <fetch dir> is on your data disks.

    Then you have to extract the ports using:
    Code:
    portsnap extract -d <fetch dir> -p <ports dir>
    The ports dir should be on your data disks as wel.

    now go to <ports dir>/misc/compat7x and run
    Code:
     make install clean
    For me, that gave a file not found error that I solved by editing
    /usr/share/mk/bsd.port.mk

    Change the PORTSDIR? line to
    Code:
     PORTSDIR?=<ports dir>
    then run the make command again.

    Now you'll need to add a lot of dependencies of serviio, enter the following commands:
    Code:
    pkg_add -v -r xtrans
    pkg_add -v -r xproto
    pkg_add -v -r xextproto
    pkg_add -v -r javavmwrapper
    pkg_add -v -r ffmpeg
    When that's done there's only one more dependency to get: the Java JRE
    go to this page and download the FreeBSD 7.x JRE for your architecture.
    In my case the file was called "diablo-jre-freebsd7.amd64.1.6.0.07.02.tbz"
    You'll need to store that somewhere on your data disks as well.
    Then go to the place where you stored the file and enter
    Code:
    pkg_add -v diablo-jre-freebsd7.amd64.1.6.0.07.02
    Make sure to change the filename if you got another architecture.

    This takes a while and will probably generate some warnings about some of your packages being to new, but you can safely ignore those.

    Ok, now that we've gotten all prerequisites of serviio installed we can now install serviio itself.
    Go to the serviio site and download the linux tar.gz file.
    Place this somewhere on your NAS, I put it in a data directory again.

    Go to the directory containing the file and unzip it:
    Code:
     tar xvfz serviio-0.5.2-linux.tar.gz
    Now we have to replace the startup script with an edited version of it.
    Go to the bin folder and backup your old config file:
    Code:
    mv serviio.sh serviio.sh.old
    Then create a new serviio.sh file, using vi or nano or whatever editor you like and paste the following into it:
    Code:
    #!/bin/sh
    ### ====================================================================== ###
    ##                                                                          ##
    ##  Serviio start Script                                                    ##
    ##                                                                          ##
    ### ====================================================================== ###
    
    DIRNAME=`dirname $0`
    PROGNAME=`basename $0`
    
    # OS specific support (must be 'true' or 'false').
    cygwin=false;
    darwin=false;
    linux=false;
    case "`uname`" in
        CYGWIN*)
            cygwin=true
            ;;
    
        Darwin*)
            darwin=true
            ;;
            
        Linux)
            linux=true
            ;;
    esac
    
    # 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
    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.jar:$SERVIIO_HOME/lib/derby.jar:$SERVIIO_HOME/lib/jcs.jar:$SERVIIO_HOME/lib/concurrent.jar:$SERVIIO_HOME/lib/freemarker.jar:$SERVIIO_HOME/lib/httpcore.jar:$SERVIIO_HOME/lib/jaudiotagger.jar:$SERVIIO_HOME/lib/jul-to-slf4j.jar:$SERVIIO_HOME/lib/jcl-over-slf4j.jar:$SERVIIO_HOME/lib/log4j.jar:$SERVIIO_HOME/lib/sanselan.jar:$SERVIIO_HOME/lib/slf4j-api.jar:$SERVIIO_HOME/lib/slf4j-log4j12.jar:$SERVIIO_HOME/lib/org.restlet.jar:$SERVIIO_HOME/lib/org.restlet.ext.xstream.jar:$SERVIIO_HOME/lib/xstream.jar:$SERVIIO_HOME/config"
    
    # Setup Serviio specific properties
    JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Dderby.system.home=$SERVIIO_HOME/library -Dserviio.home=$SERVIIO_HOME -Dserviio.remoteHost=192.168.0.188"
    
    # 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_CLASS_PATH=`cygpath --path --windows "$SERVIIO_CLASS_PATH"`
    fi
    
    # Execute the JVM in the foreground
    "$JAVA" -Xmx384M $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"
    Make sure to change the ip-address 192.168.0.188 to the ip-address of your NAS.

    That's it, you can now run
    Code:
     ./serviio.sh &
    And serviio will run.

    Use the console from another pc to connect and set it up, you can find instructions to do so here.
    Last edited by ProtoSD; 10-21-2011 at 09:57 PM. Reason: Improved the tutorial

  2. #2
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    A step by step tutorial would be greatly appreciated (when you have time). -- Thanks

  3. #3
    Stefan Reek
    Guest
    Well I've found some time to expand the tutorial a bit, it now contains all the steps necessary to install serviio on your system.
    I hope the steps are clear enough. I'm curious to see if this works for you.

    If I have some time I'll try to see if I can make a nice startup script so you don't have to run the script manually everytime the system is rebooted.

  4. #4
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    I won't have time to try it out until tomorrow evening but I'm excited to give it a go. -- Many thanks.

  5. #5
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    I tried this last night and was not able to get past the ports install.
    I changed the PORTSDIR? to reflect my location and got past the "file not found" error but ended with this:
    Code:
    freenas02#  make install clean
    ===>  Installing for compat7x-amd64-7.3.703000.201008_1
    ===>   Generating temporary packing list
    ===>  Checking if misc/compat7x already installed
    (cd /mnt/vol01/storage/serviio/ports/misc/compat7x/work/compat7x-amd64-7.3.70300 0.201008/lib && install  -o  -g  -m  *.so.* /usr/local/lib/compat)
    install: invalid file mode: libalias.so.6
    *** Error code 64
    
    Stop in /mnt/vol01/storage/serviio/ports/misc/compat7x.
    Any ideas?

  6. #6
    Stefan Reek
    Guest
    When I run "make install clean" the command is:
    Code:
    install  -o root -g wheel -m 444 *.so.* /usr/local/lib/compat
    A quick look at the makefile shows that for some reason ${INSTALL_DATA} is not correct for you.
    You might be able to solve it by adding
    Code:
    INSTALL_DATA=install -o root -g wheel -m 444
    to the top of the Makefile in /mnt/vol01/storage/serviio/ports/misc/compat7x
    Or maybe below the line
    Code:
    .include <bsd.port.pre.mk>
    Let me know if that works

    I should also note that after rebooting I had to
    Code:
    mount -urw /
    pkg_add -v -r javavmwrapper
    To be able to start serviio again, so the solution is not perfect yet.

    I do have serviio and transmission working now on my system

  7. #7
    Junior Member
    Join Date
    Aug 2011
    Posts
    5
    I use csup to install serviio as serviio is available under fresh ports.

    packages needed

    xtrans
    xproto
    xextproto
    javavmwrapper
    diablojdk.....

    then compile and install serviio under /usr/ports/net/serviio...

  8. #8
    Senior Member joeschmuck's Avatar
    Join Date
    May 2011
    Location
    Dark Side of the Moon
    Posts
    1,348
    Quote Originally Posted by VNMan View Post
    I use csup to install serviio as serviio is available under fresh ports.

    packages needed

    xtrans
    xproto
    xextproto
    javavmwrapper
    diablojdk.....

    then compile and install serviio under /usr/ports/net/serviio...
    You make it sound easy. Could you update your posting to include a step by step guide. I know Stefan started this How To guide for which I am grateful. I will try it out next week when I return home.

    I am curious on two things: 1) how much of an impact did it have to the free file space on the Flash drive (boot), 2) What sized flash drives are you both using?
    FreeNAS 8.3.1-Release-p1 w/MiniDLNA Plugin + MiniDLNA Automatic Scan Fix
    Gigabyte P45T-ES3G | Intel E8500 (3.2GHz) CPU | 16GB DDR3 1066 RAM
    Six WD Red WD20EFRX NAS Hard Drives (RAIDZ2, 7.3TB usable space)
    Adata PD7 USB Flash Drive (4GB) for OS | 1GB Patriot Xporter USB Flash Drive for Scripts & Plugins
    APC Back-UPS Pro BR1000G

  9. #9
    Junior Member
    Join Date
    Aug 2011
    Posts
    5
    I think my method is almost the same but...
    OK here goes

    I find it much easier to ssh to the FreeNAS box than connect directly. I am sure there is a how to install ssh but here is my short version -

    First you need to activate ssh service on FreeNAS and create a user that is in the group "wheel". Then this is the only time you need to connect directly to FreeNAS, you need to login to FreeNAS and do

    mount -uw /
    pkg_add sudo
    nano /etc/sudoers (this is to make the user that you created earlier on to use sudo), search for "wheel" comment out # in front of "wheel". Save and exit nano.
    Use putty to logon using ssh....

    ssh 192.168.0.1 (you need to change the ip according to your FreeNAS ip)
    sudo su
    mount -uw /
    pkg_add -rv xtrans
    pkg_add -rv xproto
    pkg_add -rv xextproto
    pkg_add -rv javavmwrapper
    pkg_add -rv ffmpeg
    Download Java jre / jdk and install as in the first post.

    From now on my method is a little different than Stefan's.

    Follow this guide herehttp://www.freebsd.org/doc/handbook/ports-using.html

    csup -L 2 /mnt/Data/Temp/ports-supfile
    Since you download only portion of ports it is much smaller but you will miss two important directories and they are "Mk" and "Templates". These can be downloaded from FreeBSD website, I downloaded the whole ports.tar.gz file from ftp.freeBSD.org and extract the necessary directories and put them under /usr/ports/.

    now to compile serviio

    cd /usr/ports/net/serviio
    make
    make install clean
    The Java jre /jdk that you installed is not compatible with FreeNAS 8.x, therefore you need the file lib map.conf under /etc/ which consists of two lines -

    [/usr/local/diablo-jdk1.6.0/]
    libz.so.4 libz.so.5

    Edit /etc/rc.conf for serviio service

    nano /etc/rc.conf
    and insert these two lines -

    serviio_enable="YES"
    serviio_args=-Dserviio.remoteHost=192.168.0.1 (this is my Freenas's IP, yours will be different)
    To start serviio service -

    /usr/local/etc/rc.d/serviio start
    You will now need to install serviio-console(client) to configure your serviio Media server !!!

    joeschmuck -

    1) Since serviio uses the directory /var/db/ to store its database, you need to mount the /var somewhere else. I use a separate memory stick for this.
    2) the boot drive that I have is 8.1 GB, modified so that FreeNAS uses 7 GB for first partition. Plus an extra 2GB memory stick especially for the /var/.

  10. #10
    Junior Member
    Join Date
    Aug 2011
    Posts
    5
    The contents of ports-supfile

    *default host=cvsup.de.freebsd.org
    *default base=/usr
    *default prefix=/usr
    *default release=cvs
    *default delete use-rel-suffix
    ports-net

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •