Hello… my 1st post here… so -
After all the Twonky and WD’s DLNA server junks I thought it would be nice to find some media server wich can actually serve media files…
That’s right… the warranty… ok
***BEFORE YOU TRY ANYTHING, READ, RE-READ, RE-RE-READ EVERYTHING, AND IF THERE’S SOMETHING YOU DON’T GET, ASK HERE OR SEND ME A PM WITH THE PROBLEM***
THIS miniTUTORIAL IS FOR THOSE OF YOU WHO KNOW WHAT THEY ARE DOING (pretty strange for a tutorial, huh)
What I’m trying to say is - “I’M NOT RESPONSABILE FOR YOUR BRICKED / DAMAGED OR BETTER WORKING DEVICES NOR IF YOU WILL LOSE YOUR UNIT’S WARRANTY”
this should be enough… i guess… now let’s play
*For those of you who are still searching for an easy install of this wonderful tool:
It’s a great thing that debian’s repository contains miniDLNA (don’t care about the version as long as it does the job and I don’t have to dowongrade or upgrade any of the packages)…
Anyway, after you enable ssh trough the unit’s UI, a simple
$apt-get update $apt-get install minidlna
should “do the trick”.
*For the “mkdir: cannot create directory `/run/minidlna’: No such file or directory” - error, you can:
A - edit the minidlna’s startup script in /etc/init.d like following:
right below the - “PATH…” comment - you’ll find the “PIDDIR” entry wich is by default set to /run/$NAME. You may want to change that into /var/run/$NAME like this:
# PATH should only include /usr/* if it runs after the mountnfs.sh script ... PIDDIR=/var/run/$NAME ...
B - just symlink /var/run to /run
$ln -s /var/run /run
* I would rather modify the script instead of filling the whole system with symlinks, but that’s an idea too…
C - Creating a /run directory - NO!
Now… I saw a dozen of topics about “blank UI page problem” with the one and only solution - reset the device / rewrite the firmware, and that kind of apocalyptic workarounds…
*Like any other programs, apache uses temp files, and when there’s not enough space left on the disk to write them, it will serve you just as much as it could process… in this case smth right next to nothing… On the other hand, minidlna server (for those of you who got into the “blank page problem” after installing the minidlna server), does just the same and the default directory for the database + media art cache (wich database, trust me, can get huge) is /var/lib/minidlna and it stays right under the “/” partition, wich is just 2GB (the resize could be an ideea but not when you have 2TB of lots of small files). Ok, so the problem was, in my case, the low diskspace on the root partition, and the solution - besides uninstalling miniDLNA sever - was, ofcourse, moving the temp files:
You can easily do this by creating a folder for miniDLNA temp files on the “shares” partition:
For the server to use this folder, you will have to modify the minidlna’s config file wich is located under the /etc/ directory:
the line you’ll have to edit is:
... # Path to the directory that should hold the database and album art cache. db_dir=/shares/minidlna_temp ...
You might also want to move the default media folders from the Public directory if your NAS sits on a bigger network than your home’s. So let’s say we create 2 other folders under the “/shares” partition,
$mkdir /shares/movies /shares/music
and change “media_dir” under /etc/minidlna.conf
$nano /etc/minidlna.conf ... media_dir=V,/shares/moviesmedia_dir=A,/shares/music ...
now… miniDLNA’s install creates the “minidlna” user wich can access /share/Public/* but nothing more than that.
For some reason, setting ownership and permissions to this user for the newly created folders, won’t be enough, the server still returning some permission related error. The workaround for this, is to create a user named “minidlna” and the two directories using NAS’s web UI and to set private permissions for that user to those newly created folders through the UI itself. You may also have to do the same for the “minidlna_temp” folder for the same reason. Don’t worry, this will only allow the system to modify it’s database knowing about these changes.
You may also want to give permissions on those two folders for your “admin” (or other own) user so you can actually put some files in there.
That’s it, now you have a fully functional miniDLNA server and won’t ever have to reset the system for the “blank UI page problem” again. But IF that problem will reappear, you might wanna check for temp files before erasing the whole system.