From MusicBrainz Wiki
< User:OliverCharles
Revision as of 23:30, 7 March 2010 by Murdos (talk | contribs) (Perl setup)

MusicBrainz::Server runs really nicely on Debian. Here's how you can get it running! I'm using Debian 5.0.4 (which was stable, at the time of writing)

Perl setup

First, we need a few modules just to kick the build process off.

apt-get install libmodule-install-perl git-core build-essential

Now we can clone the core.git repository and build a Makefile to work from.

git clone git:// musicbrainz-server
cd musicbrainz-server
perl Makefile.PL

You'll see you don't have most of the modules. You could let the Makefile grab this all for you, but that's going to stick a load of junk all over you Debian system. And I don't like other people leaving their junk all around my house, do you? So, cancel that (keep answering 'no') and lets take care of the easy modules that have Debian packages:

apt-get install libcatalyst-modules-perl libcatalyst-view-tt-perl libdbd-pg-perl libexception-class-perl libhtml-tiny-perl liblocale-po-perl \
                liblist-moreutils-perl libmoose-perl libossp-uuid-perl libreadonly-perl libstring-shellquote-perl libtest-differences-perl \
                libxml-feed-perl libyaml-perl

Stable does not have everything we need though, so we will need to setup some more modules. For this, we will use the excellent local::lib to avoid putting stuff that's not Debian maintianed in our system (and keeping it in our home directory)

cd ~
tar xzf local-lib-1.004009.tar.gz 
cd local-lib-1.004009
perl Makefile.PL --bootstrap
make test
make install
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
. ~/.bashrc

This is just what it says to do on the local::lib CPAN page. Now, lets jump back in to installing the Perl modules we need (fullow the prompts you get on screen):

make installdeps

If you get tired of saying "yes" what a dependency is encountered, you might want to do this:

o conf prerequisites_policy follow
o conf commit

Once you have done this, you should manually verify the Makefile.PL is indeed satisfied. If any lines do not have "...loaded" the module is missing, and you should install it. Make a note of these, and install them with CPAN:

install Module::Name::Here

If it still fails, you can force it, with "force install Module::Name::Here"

.In my experience, some need to be installed manually through CPAN, and the following had to force installed. YMMV.

  • Catalyst::Plugin::Unicode::Encoding

Database Setup

(This is going to be much simpler, after NGS launch, phew!)

To setup the database, you need the last stable release of MusicBrainz, which is currently hosted through Subversion. We'll also be needing somewhere to put the database!

apt-get install subversion postgresql-server-dev-8.3 postgresql-contrib-8.3

Grab the latest version:

cd ~
svn co last-release
cd last-release
cp cgi-bin/ cgi-bin/

Open up cgi-bin/ and check over the database connection details. I like to use the "musicbrainz" user and database, with no password. In order to do this, make sure your pg_hba.conf is set to trust connections (well, this is the easiest solution, anyway, if you know what you're doing there are other approaches). To do this, I set my /etc/postgresql/8.3/main/pg_hba.conf to:

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all          trust
# IPv6 local connections:
host    all         all         ::1/128               trust

Remember to restart your postgresql if you make any changes.

Grab some database dumps now from


If that wget fails, check that you're using the current link (the dumps expire pretty quick!)