MOSS/Distribution Specific Instructions

From OpenUru
Revision as of 13:51, 16 February 2012 by Lyrositor (talk | contribs) (Slight formatting changes to Mac OS X section.)
Jump to: navigation, search

This document is meant to collect any known distribution-specific instructions for installing MOSS. For general directions on installation, or if your distribution isn't listed here, you can consult MOSS-Setup. The general steps described in the main setup article will be detailed for each individual OS or distribution for which documentation has been contributed. Feel free to contribute to the knowledge gathered here by adding information on the subject of your own distribution.

Linux - Ubuntu

Installing MOSS on Ubuntu is comparatively easy, and very few changes need to be made to the default instructions. In fact, what follows is mostly just applying general instructions to the specifics of this Linux distribution. Please note however that this does not provide full instructions for installation, as MOSS-Setup does a more-than-decent job of it already.

It is recommend to install MOSS only on Server LTS releases of Ubuntu for increased stability and reliability.

Current Ubuntu Server LTS version: Ubuntu 10.04.3 LTS.

Compile

Prerequisites

The programs listed on the main setup page are all conveniently available using APT. Running this command should be sufficient:

sudo apt-get install libssl-dev postgresql postgresql-server-dev-8.4 libpqxx-dev g++ autoconf automake libtool

If you also need to clone a Mercurial repository snapshot, you need to install Mercurial through the following command:

sudo apt-get install mercurial

Finally, the program unzip is recommended:

sudo apt-get install unzip

configure

By default in Ubuntu, MOSS will be installed under /usr/local. If you prefer another location (such as the home directory of the user who will run MOSS), be sure to specify with the --prefix option.

Compile

MOSS: MOSS should compile without any problems. If you are install to a root-owned directory, make sure to use sudo make install, unless you rejoice in seeing a permission error message.

PostgreSQL module: assuming you run sudo make install, the PostgreSQL module should automatically be copied over to your PostgreSQL directory. Make sure to restart PostgreSQL with the following command:

sudo service postgresql-8.4 restart

Set Up the Database

The default PostgreSQL user in Ubuntu is postgres. If you don't change anything, only he is allowed to connect to the database, even if you have created a new role in PostgreSQL. It might therefore be to your advantage to create a new role in PostgreSQL matching the user which will run the server (e.g. moss); to do so:

sudo -u postgres createuser -l $USER

Which will automatically create a new role with the same name as your current user. You can now edit SQL tables you have access to without su-ing to the postgres user (don't remember to change all appropriate moss configuration files, as detailed below).

Now you can follow all other instructions as detailed in the main setup instructions.

Configuration Files

When setting up moss_backend.cfg, make sure you specify a PostgreSQL role with read and write access to your database (this can be same user as the one who will run MOSS, already authorized of access if you followed the previous recommendations).

Mac OS X

Theoretically, Mac OS X (a UNIX-based system) ought to be able to run MOSS. It is however currently unknown whether anyone has achieved this in practice yet.

Compile

Prerequesites

First, you will need the Mac OS X Developer Tools installed.

Second, you will need to install libpqxx, zlib, and postgresql. You can use [MacPorts] to install as follows:

sudo port install libpqxx zlib postgresql84 postgresql84-server

Some instruction guides for installing PostgreSQL (such as the README for EnterpriseDB's version) suggest editing /etc/sysctl.conf and increasing the shmall setting from the default (8192 under Mac OS X 10.6, exactly 1/4096th of shmmax). Whatever number you choose for shmall, it should be (a) smaller than shmmax, and (b) divisible by 4096. For example, a valid value might be:

kern.sysv.shmall=65536

MacPorts might not create the user and group accounts for postgres. For some reason, most instructions for installing PostgreSQL from MacPorts seem to gloss over this issue. You may need to manually create the postgres User and Group. This is accomplished in two phases.

First, identify the last user and group IDs already present.

sudo dscl . -list /Users UniqueID | sort -n -k 2 | tail -n 1
sudo dscl . -list /Groups PrimaryGroupID | sort -n -k 2 | tail -n 1

For each, take the number shown and add 1. These are your UniqueID and PrimaryGroupID numbers.

Second, replace the ### in the following commands as indicated to create the user and group.

sudo dscl . -create /Users/postgres UniqueID ###
sudo dscl . -create /Users/postgres PrimaryGroupID ###
sudo dscl . -create /Users/postgres HomeDirectory /opt/local/var/db/postgresql84
sudo dscl . -create /Users/postgres NFSHomeDirectory /opt/local/var/db/postgresql84
sudo dscl . -create /Users/postgres RealName "PostgreSQL Administrator"
sudo dscl . -create /Users/postgres Password \*
sudo dscl . -create /Groups/postgres PrimaryGroupID ###
sudo dscl . -create /Groups/postgres Password \*

The following instructions must be performed after installing PostgreSQL. If the chown step fails, then you're probably missing the user and group settings indicated above.

sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
sudo chown -R postgres:postgres /opt/local/var/db/postgresql84
sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'
sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql84-server.plist

The last line above should cause the server to start on reboot. Don't reboot yet - proceed to the database setup instructions where there are more steps you'll want to complete before starting the server.

configure

The bootstrap.sh file does not currently work because libtoolize is named glibtoolize under Mac OS X. A patch has been submitted. With the patched boostrap, you'll just need to export LIBTOOLIZE=glibtoolize.

If you installed PostgreSQL and libpqxx from MacPorts, your configure command line will need to look like this:

./configure --with-postgres=/opt/local/lib/postgresql84 --with-libpqxx=/opt/local

Compile

In the postgres subdirectory, the Makefile for the UUID generator expects pg_config to be in your PATH.

export PATH=${PATH}:/opt/local/lib/postgresql84/bin

The UUID generator Makefile may also fail because the MacPorts package doesn't automate linking to SSL. Alternate Makefile:

MODULE_big = moss_uuidgen
SHLIB_LINK += -lssl
PGXS := $(shell pg_config --pgxs)
include $(PGXS)

Set Up the Database

Copy moss_uuidgen.so to /opt/local/lib/postgresql84/. From the root of your MOSS build tree:

sudo cp postgresql/moss_uuidgen.so /opt/local/lib/postgresql84/

Now you'll need to start the server. The & will background the process:

sudo su postgres -c '/opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb' &

The database user is postgres. Start psql, the postgreSQL command line interface, as user postgres:

sudo su -m postgres -c "/opt/local/lib/postgresql84/bin/psql postgres"

At the postgres prompt run these commands. If you are going to run MOSS as a user other than "moss", change the role name appropriately:

create database moss with encoding='UTF8' template = template0;
\c moss
create role moss with login;
\q

Then from the root of your MOSS build tree:

sudo su -m postgres -c "/opt/local/lib/postgresql84/bin/psql postgres -f postgresql/moss.sql"

Security Suggestion

For some installations of Postgres, experts recommend an additional step:

sudo dscl . -create /Users/postgres UserShell /usr/bin/false

After setting this up, you'll lose the ability to su to the postgres account to run other programs. So, this is a step you might take only after getting everything else working. To revert this step:

sudo dscl . -create /Users/postgres UserShell /bin/bash

NetBSD

Compile

Prerequesites

Only PostgreSQL and the autotools are needed. You can build the packages or use the prebuilt packages with pkg_add.

pkg_add automake
pkg_add libtool
pkg_add libpqxx

I recommend starting with libpqxx because it seems to lag the postgresql-client package, and installing libpqxx will get the correct client.

pkg_add postgresqlNN-server

Get the version number to match the client installed for pqxx.

Now follow the instructions:

  • copy /usr/pkg/share/examples/rc.d/pgsql to /etc/rc.d/pgsql
  • chmod 555 /etc/rc.d/pgsql
  • append pgsql=YES to /etc/rc.conf

Set Up the Database

Copy moss_uuidgen.so to /usr/pkg/lib/postgresql/

The database user is pgsql. It has root access to the DB by default. Connect from localhost (the default).

Create the database:

su -m pgsql -c "psql postgres"
create database moss with encoding='UTF8';
\c moss
create role moss with login;
\q
su -m pgsql -c "psql postgres -f moss.sql"

Then set db_user=moss in moss_backend.cfg.

Solaris

This section is currently a placeholder. If you have knowledge of the installation procedures, please fill in this section.

Substantial customizations need to be applied to MOSS in order for it to be installed on Solaris. Examples of Solaris installations of MOSS include the Minkata shard.

See Also