====== mediatomb ====== * download source from http://mediatomb.cc/ * install [[mysql]], and make sure to build with **%%--enable-thread-safe-client%%** * install [[spidermonkey]], and make sure to copy header file into js/src * build mediatomb ./configure \ --prefix=/usr/local \ --mandir=/usr/local/man \ --infodir=/usr/local/info \ --enable-mysql \ --with-mysql=/usr/local/mysql \ --enable-libjs \ --with-js-h=/Users/billh/builds/js/src make sudo make install * setup mysql database to only allow local connections from mediatomb create database mediatomb; grant all on mediatomb.* to 'mediatomb'@'localhost'; * start mediatomb (allow it to create ~/.mediatomb/) * after it sets up files and is running, type ctrl-c to shutdown mediatomb * edit ~/.mediatomb/config.xml ... localhost mediatomb mediatomb ... 49152 ... * start mediatomb again - db tables will be created in mysql * add any files you want to share in the web based UI at %%http://:49152/%% ===== Permanent Configuration ===== After completing the above steps, do the following to have mediatomb run securely on startup: * shut down mediatomb * edit config.xml * disable the UI so everyone won't have access to see every file on your host * remove the reference line /your/home/dir/.mediatomb * move the .mediatomb directory out of your home folder to /usr/local/mediatomb (no dot) * change the permissions to nobody sudo chown -R nobody:nobody /usr/local/mediatomb * create a Mac StartupItem, using the following #!/bin/sh ## # Configure MediaTomb Server ## . /etc/rc.common StartService () { if [ "${MEDIATOMB:=-NO-}" = "-YES-" ]; then ConsoleMessage "Starting MediaTomb Server" now=`date +%s` let "limit = $now + 60" /usr/local/mysql/bin/mysqladmin -s -u root --password=rootpass status > /dev/null while [ $? -ne 0 ] && [ $now -lt $limit ] do let "now = `date +%s`" if [ $now -ge $limit ]; then ConsoleMessage "MediaTomb could not be started because MySQL was not running after the timeout limit" exit 1 fi /usr/local/mysql/bin/mysqladmin -s -u root --password=rootpass status > /dev/null done sudo -u nobody /usr/local/bin/mediatomb --daemon --home /usr/local --cfgdir mediatomb --logfile /usr/local/var/mediatomb.log fi } StopService () { ConsoleMessage "Stopping MediaTomb Server" sudo killall -15 mediatomb } RestartService () { if [ "${MEDIATOMB:=-NO-}" = "-YES-" ]; then ConsoleMessage "Restarting MediaTomb Server" sudo killall -1 mediatomb else StopService fi } RunService "$1" ===== Future Development ===== * :?: Note: may also build with libjs, libmagic, id3lib, taglib