This shows you the differences between two versions of the page.
howto:linux:install:centos [2012/09/02 19:23] will |
howto:linux:install:centos [2015/01/14 15:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Based on [[howto: | ||
- | This was tested on CentOS 6.3 (Final) | ||
- | |||
- | ==== Prerequisites ==== | ||
- | * Java< | ||
- | ==== 1.Download Serviio ==== | ||
- | Always check http:// | ||
- | < | ||
- | ==== 2.Extract Serviio ==== | ||
- | < | ||
- | mv / | ||
- | ==== 3.Create Serviio' | ||
- | < | ||
- | chown -R serviio: | ||
- | </ | ||
- | ==== 4. Init.d script ==== | ||
- | Create the initscript / | ||
- | < | ||
- | # | ||
- | # chkconfig 35 85 15 | ||
- | # description: | ||
- | ### BEGIN INIT INFO | ||
- | # Provides: serviio | ||
- | # Required-Start: | ||
- | # Required-Stop: | ||
- | # Default-Start: | ||
- | # Default-Stop: | ||
- | # Description: | ||
- | ### END INIT INFO | ||
- | |||
- | SERVIIO_HOME="/ | ||
- | SERVIIO_DAEMON=" | ||
- | SERVIIO_BIN=" | ||
- | SERVIIO_USER=" | ||
- | |||
- | # Source function library. | ||
- | . / | ||
- | |||
- | RETVAL=0 | ||
- | |||
- | check() { | ||
- | # Check that we're a privileged user | ||
- | [ $(id -u) = 0 ] || exit 4 | ||
- | |||
- | # Check if SERVIIO_HOME exists | ||
- | test -d " | ||
- | |||
- | # Check if SERVIIO_BIN is executable | ||
- | test -x " | ||
- | } | ||
- | |||
- | start() { | ||
- | check | ||
- | echo -n " | ||
- | /bin/su --session-command=" | ||
- | RETVAL=$? | ||
- | if [ $RETVAL -eq 0 ]; then | ||
- | touch / | ||
- | echo_success | ||
- | else | ||
- | echo_failure | ||
- | fi | ||
- | echo | ||
- | return $RETVAL | ||
- | } | ||
- | |||
- | stop() { | ||
- | check | ||
- | echo -n " | ||
- | # Retrieve JAVA Serviio process ID | ||
- | PIDDAEMON=`pgrep $SERVIIO_DAEMON` | ||
- | [ -z " | ||
- | # Kill the daemon | ||
- | killproc " | ||
- | RETVAL=$? | ||
- | [ $RETVAL -eq 0 ] && rm -f / | ||
- | echo | ||
- | # Kill the JAVA Serviio process if exists | ||
- | [ -z " | ||
- | return $RETVAL | ||
- | } | ||
- | |||
- | restart() { | ||
- | stop | ||
- | start | ||
- | } | ||
- | |||
- | |||
- | case " | ||
- | start) | ||
- | start | ||
- | ;; | ||
- | stop) | ||
- | stop | ||
- | ;; | ||
- | force-reload) | ||
- | restart | ||
- | ;; | ||
- | restart) | ||
- | restart | ||
- | ;; | ||
- | condrestart) | ||
- | if [ -f / | ||
- | restart | ||
- | fi | ||
- | ;; | ||
- | status) | ||
- | status serviio.sh | ||
- | ;; | ||
- | *) | ||
- | echo $" | ||
- | RETVAL=2 | ||
- | esac | ||
- | |||
- | exit $RETVAL | ||
- | </ | ||
- | ==== 5. Enable service ==== | ||
- | < | ||
- | chkconfig --add serviio | ||
- | chkconfig serviio on</ | ||
- | ==== 6. Start Serviio ==== | ||
- | < | ||
- | ==== 7. Stop Serviio ==== | ||
- | < | ||
- | ==== 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)< | ||
- | iptables -A INPUT -p tcp --dport 8895 -j ACCEPT -m comment --comment " | ||
- | iptables -A INPUT -p tcp --dport 23423 -j ACCEPT -m comment --comment " | ||
- | iptables -A INPUT -p tcp --dport 23424 -j ACCEPT -m comment --comment " | ||
- | </ | ||
- | |||
- | ==== 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 [[: | ||
- | |||
- | * Remove existing packages, and install essential build packages for later< | ||
- | yum install git libfaac-devel libmp3lame-devel libtheora-devel \ | ||
- | libva-devel libvdpau-devel libvorbis-devel libX11-devel libXfixes-devel texi2html yasm \ | ||
- | libxvidcore-devel | ||
- | |||
- | * x264 (optional)< | ||
- | mkdir src | ||
- | cd src | ||
- | git clone git:// | ||
- | cd x264 | ||
- | ./configure --enable-static --prefix=/ | ||
- | make fprofiled | ||
- | make install</ | ||
- | |||
- | * Libvpx (optional)< | ||
- | git clone http:// | ||
- | cd libvpx | ||
- | ./configure | ||
- | make install</ | ||
- | |||
- | * rtmpdump< | ||
- | git clone git:// | ||
- | cd rtmpdump | ||
- | make SYS=posix</ | ||
- | |||
- | Some of the above libraries are optional, if you don't build them, remember to remove the equivilant --enable-libXXX from ./configure below. | ||
- | |||
- | * ffmpeg< | ||
- | wget http:// | ||
- | tar xvf ffmpeg-N-42368-gbf53863.tar.gz | ||
- | cd ffmpeg | ||
- | ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libtheora \ | ||
- | | ||
- | --enable-x11grab --enable-libvpx --enable-librtmp --enable-libxvid | ||
- | make | ||
- | make fprofiled | ||
- | make install</ | ||
- | |||
- | * Add the ffmpeg location to / | ||
- | < | ||
- | JAVA_OPTS=" | ||
- | |||
- | * 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:// | ||
- | |||
- | ~~NOTOC~~ |