[HOWTO] Get Roksbox working with FreeNAS 8

Status
Not open for further replies.

joelrondeau

Dabbler
Joined
Jan 28, 2012
Messages
13
This guide is for FreeNAS 8.0.X. I am working on a similar guide for 8.2.X.

Roksbox is a private channel for the Roku media player that is used to stream local content to the Roku.

I've been serving up my video files from a Windows 7 machine using IIS, but really wanted to use the NAS. I figured I'd have to wait for the plugins in 8.2, but when 8.0.3 p1 was released and I saw the multimedia release, I thought it might be available. Once I discovered it wasn't, I wondered if I could just use lighttpd to serve it up for me.

My theory was that I would need to create a directory under the existing FreeNAS www structure, and if I could access it via a web browser, then Roksbox probably could too. Initial attempts were showing no promise, so I started checking out some of the python scripts and that's when I found that FreeNAS appeared to be willing to serve up anything under the media directory without a problem. From there it was just a matter of adding the required mime type(s) and adding the directories.

Instructions:
Use SSH to login to your FreeNAS (obviously, enable SSH on the FreeNAS if you haven't already).

Login as root and mount as read/write.
Code:
su
mount -wu /


Now, modify lighttpd.conf to add the necessary mime types and turn on directory browsing. lighttpd.conf is in 2 places. I don't know if you could just modify the second place and reboot. I do know that just modifying the first place won't survive a reboot. As it is, I modified both and after a reboot, it was correct. Also, if someone wants to figure out a way to do this with sed, feel free. I just used vi.

To add mime types to lighttpd.conf, go to the area that starts with "mimetype.assign" and add lines for each mime type. For example:
".mp4" => "audio/mpeg"
".m4v" => "video/mpeg"

Directory browsing is only necessary if not using xml files for everything. You must reboot for this to take effect. To enable it, find the following two lines in lighttpd.conf and uncomment (remove the #):
#dir-listing.activate = "enable"
#dir-listing.encoding = "utf-8"

Code:
cd /etc/local/lighttpd
vi lighttpd.conf
cd /conf/base/etc/local/lighttpd
vi lighttpd.conf


Finally (for FreeNAS), create a symbolic link for your videos, music and photos under the media directory. In my case, I store my videos at /mnt/d0/movies/M4V, music at /mnt/d0/music and photos at /mnt/d0/pictures.
Then, go back to readonly.

Code:
cd /usr/local/www/freenasUI/media
ln -s /mnt/d0/movies/M4V videos
ln -s /mnt/d0/music music
ln -s /mnt/d0/pictures photos
mount -ru /


Roksbox settings:
Set the media IP address to match your FreeNAS.
Set the media root folder to "media"
Set the video folder path to "videos"
Set the music folder path to "music"
Set the photo folder path to "photos"

I use an xml file (Videos.xml) to store my movie information. For each movie, start the path with media/videos/
I do not use an xml file for music or photos. I expect similar settings are necessary.
 
Status
Not open for further replies.
Top