SlimServer

?SlimServer is a server program created by Slim Devices, Inc. It's general purpose is to integrate into one of their fine Squeezeboxes, but it's also really nice for streaming your music to any remote location. It's my understanding that although the source code is GPL, parts of it have been judged non-free according to the DFSG. This has caused some things to be removed (notably documentation, and skins), at least regarding the package in Debian Unstable. Due to these reasons, I've installed from source onto a Debian Sarge server, and a Debian Etch desktop.

The procedure isn't as bad as it looks. What follows are directions for installing the latest version of ?SlimServer (as of 04/10/2006), and configuring apache to do http_proxying so you can remote into ?SlimServer.

This HowTo was compiled with assistance from: http://forums.slimdevices.com/showthread.php?t=15548&highlight=ubuntu http://www.howtoforge.com/forums/showthread.php?t=3116 http://forums.slimdevices.com/printthread.php?t=15054 et al.

Procedure

su

cd /usr/local/

wget http://www.slimdevices.com/mint/pepper/orderedlist/downloads/download.php?\
file=http%3A//www.slimdevices.com/downloads/SlimServer_v6.2.1/SlimServer_v6.2.1.tar.gz

tar -xzvf SlimServer_v6.2.1.tar.gz

addgroup slimserver

adduser --system --ingroup slimserver slimserver

cd /usr/local

chown -R slimserver:slimserver /usr/local/SlimServer_v6.2.1.tar.gz

ln -s SlimServer_v6.2.1 slimserver

chown slimserver:slimserver slimserver

touch /etc/slimserver.conf

chmod 664 /etc/slimserver.conf

chown slimserver.slimserver /etc/slimserver.conf


init script: copy and paste into /etc/init.d/slimserver


# slimserver init script for Debian Linux
#
# This script expects slimserver to be installed in
# /usr/local/slimserver
#
# logfile will be written to
# /tmp/slimserver.log
#

DAEMON=/usr/local/slimserver/slimserver.pl
PIDFILE=/var/tmp/slimserver.pid
LOGFILE=/tmp/slimserver.log
USER=slimserver
SLIMSERVER_OPTS=""

test -x ${DAEMON} || exit 0

case "$1" in
        start)  echo -n "Starting Slimserver: "
                HOME=/home/slimserver
                start-stop-daemon --start --quiet --exec $DAEMON --chuid ${USER} -- --daemon --prefsfile=/etc/slimserver.conf --pidfile=${PIDFILE} --logfile=${LOGFILE} ${SLIMSERVER_OPTS}
                echo "slimserver"
        ;;

        stop)   echo -n "Stopping Slimserver: "
                start-stop-daemon --stop --quiet --user ${USER} --pidfile ${PIDFILE} --retry 5
                rm $PIDFILE
                echo "done"
        ;;

        force-reload|restart) $0 stop
                $0 start
        ;;

        *)      echo "Usage: $0 {start|stop|restart|force-reload}"
                exit 1;
        ;;

esac

exit 0


end init script


make it start at boot time:

chmod 755 /etc/init.d/slimserver

# update-rc.d slimserver defaults

check that slimserver is playing nicely:

/etc/init.d/slimserver start
(lynx|links|firefox) http://localhost:9000

Gotcha's

* Make sure /home/slimserver is owned by the slimserver user and group.

* If you ever run slimserver.pl as root, the configuration file will set all of the slimserver config data into the /root directory. Erase /etc/slimserver.conf, and run it again (with the init script this time).

Apache Proxying

first configure slimserver via: http://localhost:9000

IMPORTANT: ADD A USERNAME AND PASSWORD VIA THE SLIMSERVER INTERFACE BEFORE PROXYING THE ADDRESS. YOU'LL HATE YOURSELF IF SOMEONE FINDS THIS AND DOES SOMETHING NASTY.

Debian does things with apache a little bit differently (regarding configuration file locations), so if you're running another distro, the files may be laid out differently. I'm also assuming that Apache is already running and properly configured for at least basic http service.

apt-get install libapache2-mod-proxy-html libxml2-dev

from the debian apache README

mods-enabled/

so:

# cd /etc/apache2/mods-enabled
# ln -s ../mods-available/proxy.conf proxy.conf
# ln -s ../mods-available/proxy.load proxy.load
# ln -s ../mods-available/proxy_html.load proxy_html.load
# ln -s ../mods-available/headers.load headers.load

Now we need to edit some files:

vim /etc/apache2/mods-enabled/proxy.conf

change: #Allow from .your_domain.com

to: Allow from all


NOTE: this is probably a security issue. I tried setting this to .mydomain.com as well as my ip address, and neither worked.


Now we need to add the following files:

# vim /etc/apache2/mods-enabled/proxy_html.conf
<IfModule !mod_proxy_html.c>
LoadFile /usr/lib/libxml2.so
</IfModule>

vim /etc/apache2/conf.d/slimserver
<Location /slimserver/>
        RequestHeader set Referer http://localhost:9000/
        ProxyPass http://localhost:9000/
        ProxyPassReverse http://localhost:9000/
        ProxyHTMLURLMap http://localhost:9000 /slimserver
        SetOutputFilter proxy-html
        ProxyHTMLURLMap / /slimserver/
        ProxyHTMLURLMap /slimserver /slimserver
</Location>

/etc/init.d/apache2 reload

direct your browser to http://yourwebserver/slimserver/ (last slash required)

Please note: If apache is running on one box, and slimserver is running on another, feel free to change localhost in /etc/apache2/conf.d/slimserver to whatever the ip address is of the machine in which slimserver was running (eg. 192.168.x.y). You'll need to configure slimserver (via the web interface) to accept the ip address of the apache machine (Home / Server Settings / Security / Allowed IP Addresses)

SSH Proxying for SoftSqueeze

# apt-get install ssh

There's only one problem with the default configuration and getting it to work with SoftSqueeze

you'll need to edit /etc/init.d/ssh/sshd_config and change the line:

?PasswordAuthentication no

to: ?PasswordAuthentication yes


finished setting up ssh proxying for softsqueeze