Difference between revisions of "MOSS/Distribution Specific Instructions"

From OpenUru
Jump to: navigation, search
(Slight formatting changes to NetBSD section.)
Line 1: Line 1:
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.
+
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 are 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 ==
 
== Linux - Ubuntu ==
Line 6: Line 6:
 
It is recommend to install MOSS only on Server LTS releases of Ubuntu for increased stability and reliability.  
 
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.
+
'''Current Ubuntu Server LTS version:''' Ubuntu 10.04.4 LTS.
  
 
=== Compile ===
 
=== Compile ===
Line 21: Line 21:
 
==== configure ====
 
==== configure ====
  
By default in Ubuntu, MOSS will be installed under <tt>/usr/local</tt>. 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.
+
By default in Ubuntu, MOSS will be installed under <code>/usr/local</code>. 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 ====
 
==== Compile ====
  
'''MOSS:''' MOSS should compile without any problems. If you are install to a root-owned directory, make sure to use <tt>sudo make install</tt>, unless you rejoice in seeing a permission error message.
+
'''MOSS:''' MOSS should compile without any problems. If you are installing to a root-owned directory, make sure to use <code>sudo make install</code>, unless you rejoice in seeing a permission error message.
  
'''PostgreSQL module:''' assuming you run <tt>sudo make install</tt>, the PostgreSQL module should automatically be copied over to your PostgreSQL directory. Make sure to restart PostgreSQL with the following command:
+
'''PostgreSQL module:''' assuming you run <code>sudo make install</code>, 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
 
  sudo service postgresql-8.4 restart
  
 
=== Set Up the Database ===
 
=== Set Up the Database ===
  
The default PostgreSQL user in Ubuntu is <tt>postgres</tt>. 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:
+
The default PostgreSQL user in Ubuntu is <code>postgres</code>. 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
 
  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).
+
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 forget to change all appropriate moss configuration files, as detailed below).
  
 
Now you can follow all other instructions as detailed in the main setup instructions.
 
Now you can follow all other instructions as detailed in the main setup instructions.
Line 40: Line 40:
 
=== Configuration Files ===
 
=== Configuration Files ===
  
When setting up <tt>moss_backend.cfg</tt>, 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).
+
When setting up <code>moss_backend.cfg</code>, 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 ==
 
== Mac OS X ==
Line 50: Line 50:
 
==== Prerequesites ====
 
==== Prerequesites ====
  
First, you will need the Mac OS X [https://developer.apple.com/technologies/tools/ Developer Tools] installed.
+
First, you need the Mac OS X [https://developer.apple.com/technologies/tools/ Developer Tools] installed.
  
Second, you will need to install <tt>libpqxx</tt>, <tt>zlib</tt>, and <tt>postgresql</tt>. You can use [http://www.macports.org/ MacPorts] to install as follows:
+
Second, you need to install <code>libpqxx</code>, <code>zlib</code>, and <code>postgresql</code>. You can use [http://www.macports.org/ MacPorts] to install as follows:
 
  sudo port install libpqxx zlib postgresql84 postgresql84-server
 
  sudo port install libpqxx zlib postgresql84 postgresql84-server
  
Some instruction guides for installing PostgreSQL (such as the README for EnterpriseDB's version) suggest editing <tt>/etc/sysctl.conf</tt> 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:
+
Some instruction guides for installing PostgreSQL (such as the README for EnterpriseDB's version) suggest editing <code>/etc/sysctl.conf</code> 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
 
  kern.sysv.shmall=65536
  
Line 75: Line 75:
 
  sudo dscl . -create /Groups/postgres Password \*
 
  sudo dscl . -create /Groups/postgres Password \*
  
The following instructions must be performed after installing PostgreSQL. If the <tt>chown</tt> step fails, then you're probably missing the user and group settings indicated above.
+
The following instructions must be performed after installing PostgreSQL. If the <code>chown</code> step fails, then you're probably missing the user and group settings indicated above.
 
  sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
 
  sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
 
  sudo chown -R postgres:postgres /opt/local/var/db/postgresql84
 
  sudo chown -R postgres:postgres /opt/local/var/db/postgresql84
Line 85: Line 85:
 
==== configure ====
 
==== configure ====
  
The bootstrap.sh file does not currently work because <tt>libtoolize</tt> is named <tt>glibtoolize</tt> under Mac OS X. A patch has been submitted. With the patched boostrap, you'll just need to <code>export LIBTOOLIZE=glibtoolize</code>.
+
The bootstrap.sh file does not currently work because <code>libtoolize</code> is named <code>glibtoolize</code> under Mac OS X. A patch has been submitted. With the patched boostrap, you'll just need to <code>export LIBTOOLIZE=glibtoolize</code>.
  
 
If you installed PostgreSQL and libpqxx from MacPorts, your configure command line will need to look like this:
 
If you installed PostgreSQL and libpqxx from MacPorts, your configure command line will need to look like this:
Line 103: Line 103:
 
=== Set Up the Database ===
 
=== Set Up the Database ===
  
Copy <tt>moss_uuidgen.so</tt> to <tt>/opt/local/lib/postgresql84/</tt>. From the root of your MOSS build tree:
+
Copy <code>moss_uuidgen.so</code> to <code>/opt/local/lib/postgresql84/</code>. From the root of your MOSS build tree:
  
 
  sudo cp postgresql/moss_uuidgen.so /opt/local/lib/postgresql84/
 
  sudo cp postgresql/moss_uuidgen.so /opt/local/lib/postgresql84/
  
Now you'll need to start the server.  The <tt>&</tt> will background the process:
+
Now you need to start the server.  The <code>&</code> backgrounds the process:
 
  sudo su postgres -c '/opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb' &
 
  sudo su postgres -c '/opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb' &
  
The database user is postgres.  Start <tt>psql</tt>, the postgreSQL command line interface, as user postgres:
+
The database user is postgres.  Start <code>psql</code>, the postgreSQL command line interface, as user postgres:
  
 
  sudo su -m postgres -c "/opt/local/lib/postgresql84/bin/psql postgres"
 
  sudo su -m postgres -c "/opt/local/lib/postgresql84/bin/psql postgres"
Line 137: Line 137:
 
==== Prerequesites ====
 
==== Prerequesites ====
  
Only PostgreSQL and the autotools are needed. You can build the packages or use the prebuilt packages with <tt>pkg_add</tt>.
+
Only PostgreSQL and the autotools are needed. You can build the packages or use the prebuilt packages with <code>pkg_add</code>.
 
  pkg_add automake
 
  pkg_add automake
 
  pkg_add libtool
 
  pkg_add libtool
 
  pkg_add libpqxx
 
  pkg_add libpqxx
I recommend starting with <tt>libpqxx</tt> because it seems to lag the postgresql-client package, and installing libpqxx will get the correct client.
+
I recommend starting with <code>libpqxx</code> because it seems to lag the postgresql-client package, and installing libpqxx will get the correct client.
 
  pkg_add postgresqlNN-server
 
  pkg_add postgresqlNN-server
 
Where "NN" is the version number to match the client installed for pqxx.
 
Where "NN" is the version number to match the client installed for pqxx.
Line 152: Line 152:
 
=== Set Up the Database ===
 
=== Set Up the Database ===
  
Copy <tt>moss_uuidgen.so</tt> to <tt>/usr/pkg/lib/postgresql/</tt>
+
Copy <code>moss_uuidgen.so</code> to <code>/usr/pkg/lib/postgresql/</code>
  
The database user is <tt>pgsql</tt>. It has root access to the DB by default. Connect from localhost (the default).
+
The database user is <code>pgsql</code>. It has root access to the DB by default. Connect from localhost (the default).
  
 
Create the database:
 
Create the database:
Line 164: Line 164:
 
  su -m pgsql -c "psql postgres -f moss.sql"
 
  su -m pgsql -c "psql postgres -f moss.sql"
  
Then set "db_user = moss" in <tt>moss_backend.cfg</tt>.
+
Then set "db_user = moss" in <code>moss_backend.cfg</code>.
  
 
== Solaris ==
 
== Solaris ==
Line 171: Line 171:
  
 
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.
 
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 ==
 
== See Also ==
 
* [[MOSS-Setup]]
 
* [[MOSS-Setup]]
  
 
[[Category:MOSS]]
 
[[Category:MOSS]]

Revision as of 20:37, 20 February 2012

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 are 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.4 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 installing 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 forget 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 need the Mac OS X Developer Tools installed.

Second, you 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 need to start the server. The & backgrounds 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

Where "NN" is the version number to match the client installed for pqxx.

Now follow these 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