User Tools

Site Tools


howto:linux:install:centos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howto:linux:install:centos [2013/01/10 17:36]
zip [1.Download Serviio]
howto:linux:install:centos [2015/01/14 15:50]
Line 1: Line 1:
-Based on [[howto:​linux:​install:​fedora|Fedora Installation Guide]] and help from will on the forums. 
  
-This was tested on CentOS 6.3 (Final) 
- 
-==== Prerequisites ==== 
-  * Java<​code>​yum install java-1.6.0-openjdk</​code>​ 
-==== 1.Download Serviio ==== 
-Always check http://​www.serviio.org/​download for the latest version first. 
-<​code>​wget http://​download.serviio.org/​releases/​serviio-1.1-linux.tar.gz</​code>​ 
-==== 2.Extract Serviio ==== 
-<​code>​tar -C /opt -zxvf serviio-1.0.1-linux.tar.gz 
-mv /​opt/​serviio-1.0.1 /​opt/​serviio</​code>​ 
-==== 3.Create Serviio'​s user ==== 
-<​code>​useradd -d /​opt/​serviio -r serviio 
-chown -R serviio:​serviio /​opt/​serviio 
-</​code>​ 
-==== 4. Init.d script ==== 
-Create the initscript /​etc/​init.d/​serviio with the following code: 
-<​code>#​! /bin/sh 
-# 
-# chkconfig 35 85 15 
-# description:​ Start the serviio DLNA server in headless mode 
-### BEGIN INIT INFO 
-# Provides: serviio 
-# Required-Start:​ $network 
-# Required-Stop:​ $network 
-# Default-Start:​ 3 5 
-# Default-Stop:​ 0 1 2 6 
-# Description:​ Start the serviio DLNA server in headless mode 
-### END INIT INFO 
- 
-SERVIIO_HOME="/​opt/​serviio"​ 
-SERVIIO_DAEMON="​serviio.sh"​ 
-SERVIIO_BIN="​$SERVIIO_HOME/​bin/​$SERVIIO_DAEMON"​ 
-SERVIIO_USER="​serviio"​ 
- 
-# Source function library. 
-. /​etc/​rc.d/​init.d/​functions 
- 
-RETVAL=0 
- 
-check() { 
-        # Check that we're a privileged user 
-        [ $(id -u) = 0 ] || exit 4 
- 
-        # Check if SERVIIO_HOME exists 
-        test -d "​$SERVIIO_HOME"​ || exit 5 
- 
-        # Check if SERVIIO_BIN is executable 
-        test -x "​$SERVIIO_BIN"​ || exit 5 
-} 
- 
-start() { 
-        check 
-        echo -n "​Starting Serviio DLNA server: " 
- /bin/su --session-command="​$SERVIIO_BIN -headless"​ $SERVIIO_USER & 
-        RETVAL=$? 
-        if [ $RETVAL -eq 0 ]; then 
-            touch /​var/​lock/​subsys/​serviio.sh 
-            echo_success 
-        else 
-            echo_failure 
-        fi 
-        echo 
-        return $RETVAL 
-} 
- 
-stop() { 
-    check 
-    echo -n "​Shutting down Serviio DLNA daemon: " 
-    # Retrieve JAVA Serviio process ID 
-    PIDDAEMON=`pgrep $SERVIIO_DAEMON` 
-    [ -z "​$PIDDAEMON"​ ] || PIDJAVA=`ps -o pid= --ppid $PIDDAEMON` 
-    # Kill the daemon 
-    killproc "​$SERVIIO_BIN"​ 
-    RETVAL=$? 
-    [ $RETVAL -eq 0 ] && rm -f /​var/​lock/​subsys/​serviio.sh 
-    echo 
-    # Kill the JAVA Serviio process if exists 
-    [ -z "​$PIDJAVA"​ ] || kill -9 $PIDJAVA 
-    return $RETVAL 
-} 
- 
-restart() { 
-        stop 
-        start 
-} 
- 
- 
-case "​$1"​ in 
-start) 
-        start 
-        ;; 
-stop) 
-        stop 
-        ;; 
-force-reload) 
-        restart 
-        ;; 
-restart) 
-        restart 
-        ;; 
-condrestart) 
-        if [ -f /​var/​lock/​subsys/​serviio.sh ]; then 
-            restart 
-        fi 
-        ;; 
-status) 
-        status serviio.sh 
-        ;; 
-*) 
-        echo $"​Usage:​ $0 {start|stop|status|restart|condrestart|force-reload}"​ 
-        RETVAL=2 
-esac 
- 
-exit $RETVAL 
-</​code>​ 
-==== 5. Enable service ==== 
-<​code>​chmod +x /​etc/​init.d/​serviio 
-chkconfig --add serviio 
-chkconfig serviio on</​code>​ 
-==== 6. Start Serviio ==== 
-<​code>​service serviio start</​code>​ 
-==== 7. Stop Serviio ==== 
-<​code>​service serviio stop</​code>​ 
-==== 8. IP Tables rules ==== 
-(I added these to my firewall.sh I run every time I update iptables, if you use another firewall just make sure the correct ports are open)<​code>​iptables -A INPUT -p udp -m udp --dport 1900 -j ACCEPT -m comment --comment "​Serviio"​ 
-iptables -A INPUT -p tcp --dport 8895 -j ACCEPT -m comment --comment "​Serviio"​ 
-iptables -A INPUT -p tcp --dport 23423 -j ACCEPT -m comment --comment "​Serviio"​ 
-iptables -A INPUT -p tcp --dport 23424 -j ACCEPT -m comment --comment "​Serviio"​ 
-</​code>​ 
- 
-==== 9. Build ffmpeg ==== 
- 
-As of Serviio v1.0, you need ffmpeg v0.11 or greater so in most cases you will need to build ffmpeg from source, rather than use the version from yum. 
- 
-As per [[:​build_ffmpeg_linux|Building FFmpeg on Linux]] but edited slightly for CentOS: 
- 
-  * Remove existing packages, and install essential build packages for later<​code>​yum remove x264 ffmpeg -y 
-yum install git libfaac-devel libmp3lame-devel libtheora-devel \ 
-libva-devel libvdpau-devel libvorbis-devel libX11-devel libXfixes-devel texi2html yasm \ 
-libxvidcore-devel ​ libXext-devel libXfixes-devel librtmp-devel -y</​code>​ 
-    
-  * x264 (optional)<​code>​cd ~ 
-mkdir src 
-cd src 
-git clone git://​git.videolan.org/​x264 
-cd x264 
-./configure --enable-static --prefix=/​usr 
-make fprofiled 
-make install</​code>​ 
- 
-  * Libvpx (optional)<​code>​cd ~/src 
-git clone http://​git.chromium.org/​webm/​libvpx.git 
-cd libvpx 
-./configure 
-make install</​code>​ 
- 
-  * rtmpdump<​code>​cd ~/src 
-git clone git://​git.ffmpeg.org/​rtmpdump 
-cd rtmpdump 
-make SYS=posix</​code>​ 
- 
-Some of the above libraries are optional, if you don't build them, remember to remove the equivilant --enable-libXXX from ./configure below. 
- 
-  * ffmpeg<​code>​cd ~/src 
-wget http://​download.serviio.org/​opensource/​ffmpeg-N-42368-gbf53863.tar.gz 
-tar xvf ffmpeg-N-42368-gbf53863.tar.gz 
-cd ffmpeg 
-./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libtheora \ 
- ​--enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 \ 
---enable-x11grab --enable-libvpx --enable-librtmp --enable-libxvid 
-make 
-make fprofiled 
-make install</​code>​ 
- 
-  * Add the ffmpeg location to /​opt/​serviio/​bin/​serviio.sh by updating the following line with the -Dffmpeg.location e.g.: 
-<​code>#​ Setup Serviio specific properties 
-JAVA_OPTS="​-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=$SERVIIO_HOME/​library -Dserviio.home=$SERVIIO_HOME -Dffmpeg.location=/​usr/​local/​bin/​ffmpeg"</​code>​ 
- 
-  * At this point it should be working, I have this tested on an XBox 360, if you have any troubles you may find my the forum post here useful [[http://​forum.serviio.org/​viewtopic.php?​f=7&​t=7277&​start=0]] 
- 
-~~NOTOC~~ 
howto/linux/install/centos.txt ยท Last modified: 2015/01/14 15:50 (external edit)