User:Rootwyrm/FreeBSD Server

From MusicBrainz Wiki
Revision as of 22:19, 16 September 2012 by Rootwyrm (talk | contribs) (Created page with " == Configuring MusicBrainz Server on FreeBSD 8.x and 9.x == What you'll need: * FreeBSD 8.x or FreeBSD 9.x with root or sudo access * Optionally, the ability to create a new...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Configuring MusicBrainz Server on FreeBSD 8.x and 9.x

What you'll need:

  • FreeBSD 8.x or FreeBSD 9.x with root or sudo access
  • Optionally, the ability to create a new user as well.
  • An up to date ports tree
  • Some very basic Perl and shell scripting (at this time)

First Steps

First, you'll need to add or choose a user to run the MusicBrainz Server as. The username and group doesn't matter too much (don't put them in wheel obviously.) Never run the server as root.

Ensure your ports tree is up to date (either using portsnap update or csup.) You must build some packages from ports to ensure options are set correctly. The options presented are intended for a 'bare minimums' install.

It is very important that you follow the steps in this guide in the exact order in which they are written. If you build things out of order, this can result in options being set incorrectly or dependencies not being installed correctly.

Local Database Server - Building Ports

  • bash shell - use defaults when prompted by dependencies.
cd /usr/ports/shells/bash && make install
OPTIONALLY:
pkg_add -r bash
  • Perl 5.14
cd /usr/ports/lang/perl5.14
make -Dusesitecustomize install
  • PostgreSQL 9.1 - Local Database (gcc, ICC, xlC++ - for clang builds, omit -Doptimized_cflags)
cd /usr/ports/databases/postgresql91-server
make -Dnls -Dxml -Dtzdata -Dintdate -Dssl -Doptimized_cflags
make install
cd /usr/ports/databases/postgresql91-contrib
make install
cd /usr/ports/databases/postgresql91-plperl
make install
  • Memcached - use defaults (No REPCACHED, No SASL)
cd /usr/ports/databases/memcached && make install
  • Git

Ensure only the following options are selected:

    • CONTRIB
    • ETCSHELLS
    • ICONV
    • NLS
    • PERL
cd /usr/ports/devel/git
make config -- this is where you select options
make install
  • GNU Make
cd /usr/ports/devel/gmake && make install
  • expat libraries
cd /usr/ports/textproc/expat2 && make install
  • Gnome XML libraries (libxml2)
cd /usr/ports/textproc/libxml2 && make install
  • Carton - this will pull in a number of Perl dependencies as well
cd /usr/ports/devel/p5-carton && make install
  • DBD::Pg - this must be installed
cd /usr/ports/databases/p5-DBD-Pg && make install

At this point, you should now add any additional packages you desire for flavor (such as editors, additional shells, interpreters and so on.)

Remote Database Server - Building Ports

This is for configurations where the database will reside on a separate system. You will need to know how to use scp, and also to consult the documentation for your database system to ensure you have the correct packages and libraries installed and have configured Memcached correctly. No assumptions are made about PostgreSQL version or host operating system for the remote server in this scenario.

  • bash shell - use defaults when prompted by dependencies.
cd /usr/ports/shells/bash && make install
OPTIONALLY:
pkg_add -r bash
  • Perl 5.14
cd /usr/ports/lang/perl5.14
make -Dusesitecustomize install
  • PostgreSQL 9.1 - (gcc, ICC, xlC++ - for clang builds, omit -Doptimized_cflags)
cd /usr/ports/databases/postgresql91-client
make -Dnls -Dxml -Dtzdata -Dintdate -Dssl -Doptimized_cflags
make install
  • Git

Ensure only the following options are selected:

    • CONTRIB
    • ETCSHELLS
    • ICONV
    • NLS
    • PERL
cd /usr/ports/devel/git
make config -- this is where you select options
make install
  • GNU Make
cd /usr/ports/devel/gmake && make install
  • expat libraries
cd /usr/ports/textproc/expat2 && make install
  • Gnome XML libraries (libxml2)
cd /usr/ports/textproc/libxml2 && make install
  • Carton - this will pull in a number of Perl dependencies as well
cd /usr/ports/devel/p5-carton && make install
  • DBD::Pg - this must be installed
cd /usr/ports/databases/p5-DBD-Pg && make install

At this point, you should now add any additional packages you desire for flavor (such as editors, additional shells, interpreters and so on.)

Setting up the MusicBrainz Server

You must change the default shell for the musicbrainz user to /usr/local/bin/bash and ensure this user's .bash_login includes a path statement which includes /usr/local/bin:/usr/local/sbin.

Change to the user which you will run musicbrainz-server as.

Clone the current Git repository:

git clone git://git.musicbrainz.org/musicbrainz-server.git

Now perform FreeBSD specific configuration for your .gitignore file. You will add the following line to the end of the .gitignore file:

echo "/admin/cron/freebsd*" >> musicbrainz-server/.gitignore
NOTE: This is a temporary solution until the various cron scripts are fixed to be path neutral.

You will now need to perform more than a little dancing with Carton to ensure packages are installed correctly:

<nowiki>cd musicbrainz-server

carton install DBD::Pg carton install Catalyst::Plugin::ErrorCatcher carton install --deployment