In Memoriam: Tai'lahr
OpenUru.org, along with the rest of the Mystonline community, is mourning the loss of Tai'lahr on October 16th, 2019.
Rest in Peace, friend.
Difference between revisions of "MOSS/Distribution Specific Instructions"
(→MacOS X: how to build the uuid generator on Mac OS X) |
|||
Line 48: | Line 48: | ||
sudo dscl . -create /Users/postgres PrimaryGroupID ### | sudo dscl . -create /Users/postgres PrimaryGroupID ### | ||
sudo dscl . -create /Users/postgres HomeDirectory /opt/local/var/db/postgresql84 | sudo dscl . -create /Users/postgres HomeDirectory /opt/local/var/db/postgresql84 | ||
− | |||
sudo dscl . -create /Users/postgres RealName "PostgreSQL Administrator" | sudo dscl . -create /Users/postgres RealName "PostgreSQL Administrator" | ||
sudo dscl . -create /Users/postgres Password \* | sudo dscl . -create /Users/postgres Password \* | ||
Line 59: | Line 58: | ||
sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb' | 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 | sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql84-server.plist | ||
+ | |||
+ | ==== 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 | ||
== Database Setup == | == Database Setup == |
Revision as of 18:49, 2 November 2011
This document is meant to collect any known distribution-specific instructions for installing MOSS. There are two main parts: installing the prerequisite packages, and setting up the PostgreSQL database. Feel free to add any other notes you may find useful.
Prerequisite Packages
NetBSD pkgsrc
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
MacOS X
First, you will need the MacOS X developer tools installed.
Second, you will need to install libpqxx, zlib, and postgresql. Here is one approach:
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 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 postgres:postgres /opt/local/var/db/postgresql84/defaultdb 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
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
Database Setup
NetBSD pkgsrc
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.
MacOS X
Content to be advised.
Additional Notes
MacOS X
The bootstrap.sh file does not currently work because libtoolize is named glibtoolize under MacOS. 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
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)