User Tools

Site Tools


howto:bsd:install:freebsd

This is an old revision of the document!


FreeBSD Installation Guide

Introduction

Serviio via the FreeBSD Ports collection is not too difficult to set up. It will, however, take some time to compile based on the speed of your PC. The following instructions were adapted from my notes taken and posted on Github for my home FreeBSD server. They worked with Serviio 1.2.1_1 and version 1.4beta of the PHP WebUI. If your run into any issues or are looking for more information please check out or submit and issue at https://github.com/junovitch/my-freebsd-build
–Jason Unovitch, July 2013

Prerequisites

* Please substitute mydomain.name, /PATH/TO/MEDIA, 192.168.1.200, and the email address for what works in your environment. Your chosen 'serviio.mydomain.name' must be resolvable by DNS in order to prevent issues during startup.

* It's assumed that you have a current ports collection and ports-mgmt/portmaster will be used for installing from ports. If not perform the following

portsnap fetch update
cd /usr/ports/ports-mgmt/portmaster && make install clean

Optional Prerequisite (Serviio via Ezjail)

Serviio can be installed in a Jail and presented access via a read-only Nullfs mount of media directory. If you already have sysutils/ezjail configured then you can do that via the following.

ezjail-admin create serviio.mydomain.name 192.168.1.200
mkdir -p /usr/jails/serviio.mydomain.name/PATH/TO/MEDIA
echo '/PATH/TO/MEDIA /usr/jails/serviio.mydomain.name/PATH/TO/MEDIA nullfs ro 0 0' >> /etc/fstab.serviio_mydomain_name
ezjail-admin console -f serviio.mydomain.name

Install Packages from Ports

Set recommended ffmpeg1 options then install Serviio via the Ports collection.

cd /usr/ports/multimedia/ffmpeg1 && make config WITH_RTMP=YES WITH_X11GRAB=YES WITH_FAAC=YES WITH_LAME=YES WITH_AMR_NB=YES WITH_AMR_WB=YES
portmaster net/serviio

Set 'DLNA' user to a different home directory and let pw create that directory. This is required since Serviio needs a dedicated home directory to write to that is not met through the default 'DLNA' user provide by the Ports collection.

pw usermod dlna -m -d /var/dlna

Activate Serviio

* Note the shorter advertisement duration ensures device on your LAN see the server quicker than the default 3 minute possible wait. It is not required.
* If you wish to use the web interface, you may leave the remoteHost variable set to your local IP.
* If you decide to remotely manage this Serviio instance via a PC on your network, you can set that address as needed to a PC on your LAN and skip out on the remaining steps for setting up Apache/PHP and the PHP WebUI.

echo 'serviio_enable="YES"' >> /etc/rc.conf
echo serviio_args=\'-Dserviio.advertisementDuration=\"15\" -Dserviio.remoteHost=\"192.168.1.200\"\' >> /etc/rc.conf
service serviio start

Install Apache 2.4 and PHP5 prequisities for PHP WebUI Interface

portmaster www/apache24
cd /usr/ports/lang/php5 && make config WITH_APACHE=YES
portmaster lang/php5 ftp/php5-curl textproc/php5-xml converters/php5-mbstring devel/php5-json textproc/php5-simplexml textproc/php5-dom

Fetch the current WebUI

More information regarding the unofficial PHP WebUI can be found at http://wiki.serviio.org/doku.php?id=phpwebui.

cd /tmp && fetch https://dl.dropboxusercontent.com/u/42061/WebUI%20v1.4beta.zip
unzip -d /usr/local/www/apache24/data/ WebUI%20v1.4beta.zip

Configure httpd.conf file

Copy/paste the following Perl in-place edits to hard set the Serviio PHP directory as the root page served as well as configure required PHP prerequisites.

cd /usr/local/etc/apache24; cp httpd.conf httpd.conf.original
perl -pwi -e 's^DocumentRoot "/usr/local/www/apache24/data"^DocumentRoot "/usr/local/www/apache24/data/serviioweb-1.4beta"^g' httpd.conf
perl -pwi -e 's^<Directory "/usr/local/www/apache24/data">^<Directory /usr/local/www/apache24/data/serviioweb-1.4beta>^g' httpd.conf
perl -pwi -e 's^DirectoryIndex index.html^DirectoryIndex index.html index.php^g' httpd.conf
perl -pwi -e 's^AddType application/x-gzip .gz .tgz^AddType application/x-gzip .gz .tgz\n AddType application/x-httpd-php .php\n AddType application/x-httpd-php-source .phps^g' httpd.conf

Optionally, update email contact and host/domain name and copy/paste the following in-place edits.

perl -pwi -e 's^ServerAdmin you\@example\.com^ServerAdmin YOUR.EMAIL\@mydomain.name^g' httpd.conf
perl -pwi -e 's^#ServerName www.example.com:80^ServerName serviio.mydomain.name:80^g' httpd.conf

Activate Apache

echo 'apache24_enable="YES"' >> /etc/rc.conf
apachectl start

Congratulations! You can now access your Serviio page via http://serviio.mydomain.name/ on your local network to finish configuration.

howto/bsd/install/freebsd.1374194726.txt.gz · Last modified: 2013/07/19 00:45 by junovitch