This page basically describes how I setup a Knoppix 5.0.1 instance to be a Sockso music server in what is really an appliance mode. Of course you can use any newer Knoppix release, and probably shortcut a few steps - but based on the size of the disk in the server Im using (6 Gb), I needed to keep the install small and tight - so I needed a CD based release, not the DVD as the DVD tries to install more software than I have room for. I would imagine that 5.1.1 would work even better than 5.0.1 but I didnt have it and was tired of burning ISO's.
Anyway, this page is an extension of my other Sockso Music Server page, which really just explains how to install it on any given machine, application only. This page differs by explaining the whole server build.
There were a few steps to get this going. I'll lay them out below as I had done them.
root@knockso [~]# cat /etc/passwd root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh ... bacula:x:112:112:Bacula:/var/lib/bacula:/bin/false sockso:x:575:575:Sockso Player User:/home/sockso:/bin/bash sockso2:x:576:575:Sockso Download User:/home/sockso2:/bin/bash root@knockso [~]# passwd sockso root@knockso [~]# passwd sockso2
root@knockso [~]# cat /etc/group root:x:0: daemon:x:1: bin:x:2: ... bacula:x:112: sockso:x:575:
root@knockso [~]# cd /home root@knockso [~]# mkdir sockso root@knockso [~]# mkdir sockso2 root@knockso [~]# chown -R sockso:sockso /home/sockso root@knockso [~]# chown -R sockso2:sockso /home/sockso2
## ## End Default Options ## title Debian GNU/Linux, (2.6.17) FluxBox root (hd0,1) kernel /boot/vmlinuz root=/dev/hda2 ro ramdisk_size=100000 init=/etc/init lang=us apm=power-off nomce quiet vga=791 desktop=fluxbox initrd /boot/initrd.img savedefault boot title Debian GNU/Linux, (2.6.17) Default root (hd0,1) kernel /boot/vmlinuz root=/dev/hda2 ro ramdisk_size=100000 init=/etc/init lang=us apm=power-off nomce quiet vga=791 initrd /boot/initrd.img savedefault boot title Debian GNU/Linux, kernel 2.6.17 root (hd0,1) kernel /boot/vmlinuz-2.6.17 root=/dev/hda2 ro ramdisk_size=100000 init=/etc/init lang=us apm=power-off nomce quiet vga=791 initrd /boot/initrd.img-2.6.17 savedefault boot
root@knockso [~]# cat /etc/network/interfaces
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
# automatically added when upgrading
auto lo eth1
iface lo inet loopback
iface eth1 inet static
address 207.86.37.64
netmask 255.255.255.0
network 207.86.37.0
broadcast 207.86.37.255
gateway 207.86.37.253
root@knockso [~]# cat /etc/resolv.conf domain pluzzi.com nameserver 207.86.37.1 nameserver 207.86.37.253 search pluzzi.com
root@knockso [~]# who -r root@knockso [~]# cd /etc/rc5.d root@knockso [~]# ln -s ../init.d/klogd ./S30klogd root@knockso [~]# ln -s ../init.d/sysklogd ./S30sysklogd root@knockso [~]# ln -s ../init.d/cron ./S40cron root@knockso [~]# ln -s ../init.d/ssh ./S50ssh root@knockso [~]# cd ../rc0.d root@knockso [~]# ln -s ../init.d/klogd ./K30klogd root@knockso [~]# ln -s ../init.d/sysklogd ./K30sysklogd root@knockso [~]# ln -s ../init.d/cron ./K40cron root@knockso [~]# ln -s ../init.d/ssh ./K50ssh
root@knockso [~]# cd /bin root@knockso [~]# ln -s bash /bin/ksh root@knockso [~]# ln -s bash /usr/bin/ksh
root@knockso [~]# cd /etc/apt root@knockso [~]# cp -p sources.list sources.list.orig root@knockso [~]# vi /etc/apt/sources.list root@knockso [~]# apt-get update root@knockso [~]# apt-get install conky root@knockso [~]# which conky root@knockso [~]# conky -a top_right &
root@knockso [~]# mount root@knockso [~]# mkdir /mnt/dvd root@knockso [~]# mount -t cifs //nas/share /mnt/dvd -o ro root@knockso [~]# ln -s /mnt/dvd/music ./music
root@knockso [~]# which java root@knockso [~]# java -version root@knockso [~]# apt-cache search java root@knockso [~]# apt-cache search sun-java root@knockso [~]# apt-get sun-java6-bin root@knockso [~]# apt-get install sun-java6-bin root@knockso [~]# java -version root@knockso [~]# ls -l /usr/bin/java root@knockso [~]# ls -l /etc/alternatives/java* root@knockso [~]# apt-get remove sun-j2se-1.4-jre-binary root@knockso [~]# apt-get remove sun-j2se1.4-jre-binary root@knockso [~]# ls -l /etc/alternatives/java* root@knockso [~]# java -version
root@knockso [~]# cat /etc/init.d/sockso
#!/bin/ksh
## BEGIN INIT INFO
# Required-Start: network
# Default-Start: 3 5
# Description: Sockso Music Services
### END INIT INFO
#
#####
##### Written on 02-02-2009
#####
##### Call and startup/stop the sockso music services
#####
case "$1" in
'start')
#####
##### Mount the filesystem
#####
TESTMOUNT=`mount | grep "/mnt/dvd"`
if [ "$?" = "0" ]
then
echo "CIFS share already mounted at /mnt/dvd"
else
echo "Mounting CIFS share //nas/share at /mnt/dvd"
mount -t cifs //nas1/share /mnt/dvd -o ro,username=read,password=****
fi
echo "Setting display to 127.0.0.1:0.0"
DISPLAY="127.0.0.1:0.0" ; export DISPLAY
echo "Launching sockso music player service"
xterm -title sockso_player -e su - sockso -c ~sockso/start_sockso.sh &
echo "Launching sockso2 music download service"
xterm -title sockso2_downloads -e su - sockso2 -c ~sockso/start_sockso.sh &
;;
'stop')
#####
##### Stop the apache port 80 instance
#####
echo "Collecting sockso pids"
SOCKSO1_PIDS=`ps -ef | grep java | grep "sockso" | grep -v sockso2 | awk '{print $2}' | sort -nr`
echo "Killing sockso pids"
kill -9 $SOCKSO1_PIDS
#
echo "Collecting sockso2 pids"
SOCKSO2_PIDS=`ps -ef | grep java | grep "sockso2" | awk '{print $2}' | sort -nr`
echo "Killing sockso2 pids"
kill -9 $SOCKSO2_PIDS
#
echo "Unmounting the share"
umount /mnt/dvd
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
root@knockso [~]#
root@knockso [~]# cd /etc/init.d root@knockso [~]# mount root@knockso [~]# ./sockso start root@knockso [~]# mount root@knockso [~]# ./sockso stop root@knockso [~]# mount root@knockso [~]# reboot
Thats it for the setup portion. Now you can launch a browser from anywhere - the linux server, or a windows client (preferably with an audio card and speakers).
Thats it !
Note that I totally left out the part about getting sockso working because I had already done that before. If you dont have it already instealled , in between steps 13 and 14, follow the info on my other Sockso Music Server page, which has all the details of setting up the Sockso service. This project was just setting up a dedicated server, and copying the files over to this box.
You can find much more about that in their online manual.