Friday, July 17, 2009

HOWTO : Sockso 1.1.8 (Music Server) on Ubuntu 9.04 Server

Sockso is a cross platform music server and requires no installation. She runs on a standalone personal computer or on a server. For running on personal computer with GUI, please refer to her official site.

The client computer requires no mp3 player to play the music but needs a Flash player.

The advantage of Sockso is that you can listen to your mp3 files at anytime and anywhere under the condition that fast internet connection is available. The disadvantage is that you should have at least IEEE 802.11g (54M) Wifi connection for smooth operation.

Sockso requires Sun Java only and it is requires no Apache or other web server to run.

Step 1 :

Sockso requires Sun Java to work. You should install the following packages.
sudo apt-get install sun-java6-bin sun-java6-fonts sun-java6-jre unzip

Step 2 :

Download the latest version of Sockso. The current version is 1.1.8 at the time of this writing.


sudo mkdir /usr/share/sockso

sudo cp -R /home/samiux/sockso-1.1.8/* /usr/share/sockso/*

sudo mkdir /var/sockso
sudo chmod -R 0755 /var/sockso

Step 3 :

Run the Sockso at command prompt.
sudo sh /usr/share/sockso/ --nogui --datadir /var/sockso

If you have some mp3 at /home/samiux/music and /home/mary/mp3, just runs the following command to make the music collection.
#SockSo#>coladd /home/samiux/music
#SockSo#>coladd /home/mary/mp3

If you want to list all collections, use the following command.
If you want to delete one of the collections, use the following command.
Add a user to the Sockso.
#SockSo#>useradd samiux <your_password_here>

To exit the #SockSo#> command prompt.

Step 4 :

Copy the init.d script to /etc/init.d/
sudo cp /usr/share/sockso/scripts/init.d/sockso /etc/init.d/

Create a sockso script file.
sudo nano /etc/init.d/sockso

-------- CUT HERE ---------

perl /etc/init.d/ $1

exit 0
-------- CUT HERE ---------

Edit the as the following.
sudo nano /etc/init.d/

use constant SOCKSO_DIR => "/usr/share/sockso/";

system( 'sh --nogui --datadir /var/sockso > /dev/null 2>&1 &' );

Step 5 :

Now, you can start the sockso with the following command.

sudo chmod +x /etc/init.d/sockso
sudo chmod +x /etc/init.d/

sudo /etc/init.d/sockso start

You can also stop the sockso with the following command.
sudo /etc/init.d/sockso stop

Listen to the music with your browser.

Step 6 :

Make the script to be ran automatically after reboot.

sudo update-rc.d sockso defaults

Remarks : Make sure you have stopped the Sockso before reboot or shutdown; otherwise, the mp3 databases would be corrupted. If so, you should delete everything inside /var/sockso and redo the Step 3.

Remarks : Don't broadcast copyrighted musics or songs. Or, you may be in lawsuit.

That's all. See you!