How-To install Gjukebox on Ubuntu

Seperator

Update - 17/05/09

I have created a new version of the gjukeboxinstaller, incorporating all my bug fixes.
Also the new install script installs all required packages on a Ubuntu system, tested with Ubuntu 8.04/8.10/9.04.
Check out the new install page HERE. Seperator

Gjukebox is an excellent jukebox that runs on a backbone of perl, a webserver, and a set of applications to do the mp3 playing, encoding, etc.
It has quite a nice interface which is very easy to use and very customisable. (through configuration and webpages)
(screenshot of the metal theme at the bottom of the page)

Last year I spent a couple of hours setting up gjukebox on an old PC to serve as our pubs jukebox, this PC was running Ubuntu Feisty 7.04 and was an old Celeron 2GHz with 512MB RAM.
This system ran fine for a few months with a few bugs involving mysql and php.

Earlier this year I sat down and did a fresh install of the jukebox under vmware on my normal PC as a test bed to allow me to repair the mysql issues.
The install was fine and I managed to repair most of the mysql issues, generally the errors were due to typos and due to the new versions of mysql and php.

I have since built a new jukebox with another box I had lying around this time running hardy heron as its Ubuntu base, this box is now running in our pub and has been for a few months.
The system is 100% stable and never gives issues. (to the relief of my parents who are windows illiterate let alone linux)

Here are my install steps, lines in bold starting with a '$' are to be entered into the terminal (without the $):

Seperator

1. System Setup

Install Ubuntu (Ubuntu and its derivatives can be found here: www.ubuntu.com)
Install all the updates aswell when you have a working system.
Its a good idea to make sure you have sound and internet connection working at this point, you obviously wont be able to download the updates if you arent conected to the net.

Seperator

2. Install Required Software Packages

$ sudo apt-get install build-essential kernel-headers-$(uname-r)

$ sudo apt-get install mysql-server apache2 php5-mysql php5-gd libcdaudio-dev sox libcdparanoia0-dev mpg321 vorbis-tools perlmagick libmp3-info-perl libdbd-mysql-perl libdbi-perl lynx xinetd phpmyadmin xine-ui nvram-wakeup lame aumix mplayer libgd-gd2-perl apache2-doc libartsc0 libaudio2 php-pear dbishell libgd-tools libcompress-zlib-perl mysql-doc-5.0 tinyca mailx

Seperator

3. Install Required Perl Modules

$ perl -MCPAN -e 'install MIME::Base64'
$ perl -MCPAN -e 'install Text::Metaphone'
$ perl -MCPAN -e 'install String::CRC32'
$ perl -MCPAN -e 'install MPEG::MP3Info'

Seperator

4. Create some directories to be used for the jukebox.

$ sudo mkdir /jukebox
$ sudo mkdir /jukebox/www
$ sudo mkdir /jukebox/music

Seperator

5. Edit some configuration files

First setup the webserver:

$ sudo gedit /etc/php5/apache2/php.ini
Modify the following two variables so they match these:

Seperator

magic_quotes_gpc = Off
register_globals = On

Seperator

And then add our jukebox to the webserver:

$sudo gedit /etc/apache2/sites-available/default

Change the document root to: /jukebox/www
Then add these lines underneath:

Seperator

php_value magic_quotes_gpc 0
php_value register_globals 1

Seperator

6. Run Install Scripts

First we need to download the latest CVS of gjukebox from the net, when prompted for a password just press enter:

$ cvs -d:pserver:anonymous@gjukebox.cvs.sourceforge.net:/cvsroot/gjukebox login
$ cvs -z3 -d:pserver:anonymous@gjukebox.cvs.sourceforge.net:/cvsroot/gjukebox co -P gjukebox

Now run the installer script:

$ sudo ./gjukebox/build
skip mfm20 and rio as theyre not needed

When prompted on where you want to store web pages type: /jukebox/www
Similarly when prompted on where you want to store the music files type: /jukebox/music

6. Add volume service to xinetd

Seperator

$ sudo gedit /etc/xinetd.d/volume
And paste the following into the file and save it:

Seperator

service volume
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/local/jukebox/setvol
}

Seperator

7. Edit jukebox startup script for debian (Ubuntu)
(Thanks to Ben Brough (nopane) for these steps from the debian install guide!)

Firstly we need to create the startup files & links:
$ cp /usr/local/jukebox/jukebox /init.d/jukebox

Then we need to edit it:
$ sudo gedit /init.d/jukebox

Change Line 53 to be: (line numbers can be turned on in gedit preferences)
#. /etc/rc.d/init.d/functions

Change line62 to be:
start-stop-daemon --start --quiet --exec $JUKEBOX/ripd.pl

Change line63 to be:
touch /var/lock/jukebox

Change line73 to be:
killall ripd.pl

Change line81 to be:
rm -f /var/lock/jukebox

Seperator

This sets up the basic jukebox but there are some scripting errors in the php files which I have fixed to allow the use of the latest PHP and MySQL.
These can be viewed on another page.
Any questions or queries email me: danny@danwood.org.uk

Heres a screnie of the working jukebox: (courtesy of http://gjukebox.sourceforge.net/)

Screenshot of Metal Theme in Action