User Tools

Site Tools


howto:bsd:install:freebsd

FreeBSD Installation Guide (also Nas4Free applicable)

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 an issue at https://github.com/junovitch/my-freebsd-build
–Jason Unovitch, July 2013
–Updated: lokotito, Sept 2016

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

Optional Nas4Free Prerequisite (Serviio via TheBrig jail manager)

Installed in a Jail and presented access via a read-only Nullfs mount of media directory. If you already have TheBrig - one Jail manager for N4F configured then you can add the following full/slim jail.

Start on boot: CHECKED
In jail allow: chflags, mount, mount.devfs, mount.nullfs, mount.procfs, mount.zfs
mount/umount jail's fs: CHECKED
Enable mount devfs: CHECKED

Install Packages from Ports

Set recommended ffmpeg options then install Serviio via the Ports collection. The newest version of serviio (which if you're installing from here it's the version you'll have) will require ffmpeg2 instead of 1. I've also added an install of dcraw, while it's not required you won't be able to use some of the thumbnail and image features of serviio without it.

cd /usr/ports/multimedia/ffmpeg && make config WITH_RTMP=YES WITH_X11GRAB=YES WITH_FAAC=YES WITH_LAME=YES WITH_AMR_NB=YES WITH_AMR_WB=YES
portmaster graphics/dcraw
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

Update serviio (only if ports are outdated)

At this point, if ports are outdated you can upgrade serviio as recomended F.A.Q. - Upgrade Serviio, then continue the installation.

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

Congratulations! You can now access your Serviio page via serviio own web based console http://serviio.mydomain.name:23423/console/

If it's not running

If it doesn't run right away don't panic. There is a very verbose logfile here:

/var/log/serviio/serviio.log

For starters check the ownership of all the files in the following files and directories. If they are not all owned by the DLNA user serviio will exit on it's own with no CLI messages.

 /var/db/serviio/thumbnaios*
 /var/db/serviio/db

Install Apache 2.4 and PHP5 prequisities for PHP WebUI Interface (not needed since 1.6 version)

If you are installing +1.6 version these steps are not necesary, however boot consoles can coexist in same instalation.

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

Fetch the current WebUI (not needed since 1.6 version)

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

cd /tmp && fetch https://github.com/SwoopX/Web-UI-for-Serviio/archive/Serviio-1.5.zip
unzip -d /usr/local/www/apache24/data/ Serviio-1.5.zip

Configure httpd.conf file (not needed since 1.6 version)

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/Web-UI-for-Serviio-Serviio-1.5"^g' httpd.conf
perl -pwi -e 's^<Directory "/usr/local/www/apache24/data">^<Directory /usr/local/www/apache24/data/Web-UI-for-Serviio-Serviio-1.5>^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 (not needed since 1.6 version)

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

Now you can now access your Serviio page via http://serviio.mydomain.name

howto/bsd/install/freebsd.txt · Last modified: 2016/09/14 18:40 by lokotito