Installing Washtub on Ubuntu

A special thanks to Aditya from Institute Teknologi Bandung for his patience.  Without his correspondence, I probably couldn't have created such a comprehensive how to for installing Washtub.  With Aditya being in Indonesia and me being in the US, it sometimes took 12 hours for us to read each other's responses.  What follows here is the meat from our conversation and the main process for getting Washtub installed on Ubuntu. This is also published in the washtub svn repo at:

https://savonet.svn.sourceforge.net/svnroot/savonet/trunk/washtub

As a discaimer, please be sure to subscribe to the Liquidsoap Mailing List for support this Liquidsoap or Washtub.

https://lists.sourceforge.net/lists/listinfo/savonet-users

Make sure that you have all the dependencies installed on the apache host machine. Apache, Mod Python, TagPy, Django are all necessary to get washtub working. Once all these are installed, continue on with the installation. Liquidsoap can theoretically be running anywhere that is network accessible from the washtub instance. Download the washtub svn from the savonet project.

	svn co https://savonet.svn.sourceforge.net/svnroot/savonet/trunk/washtub washtub

Copy the directory to a permanent location on the filesystem (I like /usr/share )

	cp washtub /usr/share -R  

Copy the washtub-apache-dist.conf into the apache conf directory to setup the django/python environment.

	cp /usr/share/washtub/washtub-apache-dist.conf \
	   /etc/apache2/sites-available/washtub.conf

Edit the new washtub.conf file with your own options. Then link to it in the 'sites-enabled' directory.

	ln -s /etc/apache2/sites-available/washtub.conf /etc/apache2/sites-enabled/

Copy the washtub/django settings-disy.py to a permanent settings.py file. Edit the new settings.py to match the options in washtub/apache configuration

	cp /usr/share/washtub/wtsite/settings-dist.py \
	   /usr/share/washtub/wtsite/settings.py
	vi /usr/share/washtub/wtsite/settings.py

If you want to access local media on the washtub host, be sure to set the mediapool path in settings.py. Also, make sure this dir is writable by the apache user *and* the liquidsoap user. At this time, only mp3 and flac are supported on washtub.

	
	MEDIAPOOL_PATH = '/full/path/to/mediapool/dir' 

At this point, washtub should be configured. Now setup the database using the internal django tools.

	python /usr/share/washtub/wtsite/manage.py syncdb

Now restart apache to enable the new configuration file. NOTE: You have to restart apache everytime you make changes to the settings.py or the washtub.conf files.

	/etc/init.d/apache2 restart

We still have to connect washtub to your liquidsoap instance. Make sure that telnet is enabled in your liquidsoap script via:

	# Enable Telnet
	set("server.telnet",true)
	set("server.telnet.bind_addr","127.0.0.1")

You can also setup queues in liquidsoap to control from washtub. The 'id' parameter is very important to specify how washtub will control queues.

	admin_request = request.queue(id="admin_request")
	public_request = request.equeue(id="public_request")
	myplaylist = fallback(track_sensitive=false,
                                   [admin_request,
                                    public_request,
                                    myplaylist])

Browse to http://localhost and hopefully your site is live. Now, let's connect washtub to liquidsoap. Login to washtub using the super password that manage.py asked you for. Add a host to the admin interface using the following settings.

	
	Name:  Human readable name
	IP Address: Address of liquidsoap telnet bind address
	Base Url: http://your-icecast-server:8000
	Theme: click the '+' to add a new theme 'default'

Now add some entries to the settings table to correspond to the new host.

	Value 		Data 	Hostname
	port		1234	your-liquidsoap-hostname
	protocol	telnet	your-liquidsoap-hostname

If you setup queues in liquidsoap, you need to specify some settings that will washtub to control them specifically.

	Value 		Data 			Hostname
	queue_id    liq-queue-id  your-liquidsoap-hostname
	queue_id    liq-queue-id  your-liquidsoap-hostname

And that should get things up and running. For troubleshooting, try browinng to these urls to check that washtub is actually working. In addition to byypassing the ajax call, this will also present django debug messages if the urls fail.

	Media Pool Scan -> /mediapool/scan
	Node Status -> /status/nodes/ 	
        Queue Status -> /status/queues/ 	
        History -> /status/history/ 	
        Help -> /status/help/  	
        
        Pool Display -> 	
        /pool//song/1  #this would display page 1
	/pool//song     #this would display all without any paging

Good Luck!

Really nice tutorial. As

Really nice tutorial. As somebody who never used Django, I'm really happy to read this and realize that it doesn't seem so hard to install. Perhaps could you say which versions modpython, tagpy and django are known to work with washtub. Should I just be able to try with my stock debian packages? Finally, note that although you said that liquidsoap can be running on any machine on the network, you set bind_addr to 127.0.0.1 in the liquidsoap script, which limits its reachability to localhost.

RE: Really nice tutorial

As for versions I'm using,  I've only used Ubuntu and the only thing that I've done differently is the manual compile of liquidsoap to get mp3 playback support.  I'm currently on Ubuntu 9.10.  But I've upgraded from Ubuntu 8.10 since starting my washtub installation and I didn't have any issues with upgrading.

As for using 127.0.0.1 in bind_addr option.  I did that on purpose because I don't like opening telnet to the public.  However, I have tested my washtub instance connecting to external liquidsoap servers.  And it works just great. 

Finally, I still plan to continue development of washtub.  I'm just really busy as a new father and having a new(er) job that demands a lot of my time :-) 

python-tagpy
Version: 0.94.5-5

python-django
Version: 1.1.1-1ubuntu1

libapache2-mod-python
Version: 3.3.1-8build1