./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
<login to mysql> create database mediatomb; grant all on mediatomb.* to 'mediatomb'@'localhost';
... <storage> <!-- <sqlite3 enabled="yes"> <database-file>mediatomb.db</database-file> </sqlite3> --> <mysql enabled="yes"> <host>localhost</host> <username>mediatomb</username> <database>mediatomb</database> </mysql> </storage> <protocolInfo extend="yes"/><!-- For PS3 support change to "yes" --> ... <port>49152</port> </server> ... <mappings> <extension-mimetype ignore-unknown="no"> <map from="mp3" to="audio/mpeg"/> <map from="ogg" to="application/ogg"/> <map from="asf" to="video/x-ms-asf"/> <map from="asx" to="video/x-ms-asf"/> <map from="wma" to="audio/x-ms-wma"/> <map from="wax" to="audio/x-ms-wax"/> <map from="wmv" to="video/x-ms-wmv"/> <map from="wvx" to="video/x-ms-wvx"/> <map from="wm" to="video/x-ms-wm"/> <map from="wmx" to="video/x-ms-wmx"/> <map from="m3u" to="audio/x-mpegurl"/> <map from="pls" to="audio/x-scpls"/> <map from="flv" to="video/x-flv"/> <map from="avi" to="video/divx"/> <map from="mpg" to="video/mpeg"/> <map from="mpeg" to="video/mpeg"/> <map from="gif" to="image/gif"/> <map from="jpg" to="image/jpeg"/> <map from="png" to="image/png"/> <map from="mp4" to="video/mp4"/> <map from="mp4a" to="audio/mp4a"/> <map from="m4v" to="video/mp4"/> <map from="3gp" to="video/3gpp"/> <map from="mts" to="video/mpeg"/> <map from="m2ts" to="video/mpeg"/>
After completing the above steps, do the following to have mediatomb run securely on startup:
<server> <ui enabled="no">
<!-- delete or comment out this line entirely --> <home>/your/home/dir/.mediatomb</home>
sudo chown -R nobody:nobody /usr/local/mediatomb
#!/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"