Configuring a server to run Whitebeam

Site Map
 
Home
 
Application Guide
Reference
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Configuring a server to run Whitebeam

This page assumes that Whitebeam has been successfully installed either from source (download or GIT) or via an RPM.

You should now have a system with all the software required to run Whitebeam applications - all that remains is to configure those components.

This section assumes that you're using a Redhat-like system (RHEL, Fedora, CentOS). You should however be able to adapt these instructions for other operating system.

PostgreSQL Database

We assume here that you've not been using Postgres for anything else and you have yet to initialise the database. These notes apply to PostgreSQL version 8.4 unless otherwise stated.

Locale: we strongly recommend that before initialising the database you set your systems locale to 'C'. You can in theory use other settings however they will have an adverse performance hit on your database.

The language is set in /etc/sysconfig/i18n. Edit this file (as root) and change the LANG= value to &qout;C" and save the file.

Now initialise the database by running:

service postgresql initdb

You can set the language back at this stage if you wish.

With the database initialised you'll need to set access and then import the Whitebeam schema. The PostgreSQL initdb function should then install an empty database in /var/lib/pgsql.

pg_hba.conf - databasae connection control

You need to enable access to the PostgreSQL database from the Whitebeam templates. The easiest way to do this is to edit /var/lib/pgsql/data/pg_hba.conf. You need to have a line looking very much like:


# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust

You should configure your firewall to prevent database connections from outside your server or, in the case of a multi-server configuration, outside your DMZ.

Making PostgreSQL listen for TCP connections

By default PostgreSQL won't be listening for TCP connections - you need to enable this in order for the templates to connect.

Edit the file /var/lib/pgsql/data/postgresql.conf and make sure the following two lines are set as below:

listen_addresses = '*' # listen on all IP interfaces
port = 5432            # listen on this TCP port number

This completed, PostgreSQL is ready to be run. The following commands will switch it on and then make sure it starts automatically when the server restarts:

[user@machine]$service postgresql start
[user@machine]$chkconfig postgresql on

PostgreSQL should now be running!

Adding the Whitebeam database schema

Create a user called Whitebeam:

postgres createuser -P -s -e whitebeam

Whitebeam makes use of two contributed PostgreSQL modules: 'Cube' and 'Earth Distance'. These are used to make distance calculations based on longitude/latitude, for example "all contacts within a 5 mile radius of...". To install these contributed modules run the following commands:

psql -d template1 -f /usr/share/pgsql/contrib/cube.sql 
psql -d template1 -f /usr/share/pgsql/contrib/earthdistance.sql

You're now ready to load the schema into the system. You'll find this in:

/var/whitebeam/conf/schema_file2.sql

You can run this using the command:

psql -d template1 -f /var/whitebeam/conf/schema_file2.sql

PostgreSQL is now ready!

Whitebeam release 1.3.36
View XML source of this page
(loadtime : 6ms)