Installing Mandala on a server

This page describes the installation procedure using Windows 2008 server as the host OS. This same procedure should work just fine with Windows XP, Vista, Windows 7 and Windows 2003 server.

NB: If all goes to plan you should NOT need to reboot your server to install Mandala and PostgreSQL – which is a nice bonus considering the amount of behind the scenes action going on. You will, however, need to have administrator level access to your server. Creating a restore point prior to install is a very sensible idea.

Installation procedure follows two main branches:

a) Installing on a server that does not already have the PostgreSQL database service installed. This is the default installation and the most likely scenario.

b) Installing Mandala on a server that already has a PostgreSQL database running on it. I  deal with this separately here.

Finally, if you would like to install PostgreSQL yourself, you may find the download here, and installation instructions here. Once you have installed PostgreSQL, refer to this page for the Mandala installation component.

Installing Mandala on a server that does not already have PostgreSQL installed

If you’re the “got no time to bleed” type, you can just blast through the prompts with a cavalier “yes, yes, yes, next, next OK” style and then read the important info titled “Important configuation adjustments” at the bottom of this page if all goes well.

1. Right click the installer and select “Run as administrator” if the option exists. Otherwise just double click the icon and choose “Run” at the “Are you sure you want to run this software?” prompt.

Right click on the install package and choose “run as administrator”

2. Click Next to begin the install, accept the license agreement and choose the default install folder (Program Files).

3. Accept the default “yes let’s create a start menu folder”

The Mandala application is now installed.

That’s the easy part. Now to continue with the PostgreSQL install. You should at this point see the following dialog:

Installing postgreSQL

As you can see, you are now faced with 3 default install options selected. Since PostgreSQL is not on your system, I strongly recommend you leave all 3 as is and just click “Finish”. But so you can make an informed decision, I will describe what these do.

Check 1: Install PostgreSQL as a service

This will launch a silent, “look Ma no clicks” installer that will install PostgreSQL as a service on your server. It is a fairly lengthy install process (maybe 3 minutes), that also involves a check to see if you have the necessary Visual C++ runtimes onboard already. If you don’t, then these will be installed automatically. The install will use the following defaults:

user: postgres

port: 5432

pass: I’m not going to write it here, I will have provided it to you with the install files.

Check 2: Auto-configure the pg_hba.conf file

The mysteriously named pg_hba.conf is a file resident in the PostgreSQL data directory that contains a list of IP’s that will be allowed to interact with the PostgreSQL server. So you want this to permit all your IP addresses that will be running as Mandala client terminals. If you want to get fancy, and access the PostgreSQL over the internet, you would need to add your external IP as well here.

As a side note that the /data directory is security protected on OS X (and I imagine Linux) installs and you may need to check your security settings if you are struggling to write to this folder.

All this check does is copy a preconfigured pga_hba.conf file into the /data directory. This file contains the following line:

host all all 0.0.0.0/0 md5

which allows a connection from any remote host. This will ensure you have no problems getting started with client access, but for a production installation you should be a good little IT bean and lock down your connectivity to your local network range. See this link for detailed instructions on this file and how to do just that.

Every time you change this file, you need to force PostgreSQL to update to the new settings. You do this via the following line entered from the command prompt:

“%POSTGRES_BIN_PATH%\pg_ctl.exe”  reload -D “%POSTGRES_DATA_PATH%”

Obviously you need to substitute your correct paths in here for this line to work! If you leave this box checked, then all this is done behind the scenes for you.

Check 3. Create the Mandala default database

This step deletes the database named “Mandala” if it exists. Then it creates and populates the Mandala database. If all goes well, you should see a heap of table creation text scrolling up the DOS box. Like so:

A successful empty database install

And that’s it! You might get one unimportant error by the way – so don’t panic if it says 1. Ignored Errors. All you need to do now is run Mandala from the Start Menu. Once you do this you should see the following message box (or something like it, I tend to fiddle with the presentation a fair bit!)

Mandala connection  error

This is OK! You see this because the default password is not hard coded into Mandala. Just click YES and you will see the standard Mandala connection dialog:

Connecting to Mandala

Just enter the database user password for user postgres in the pass field and select “Test”. You should get a “Connected” message and an OK to continue. Or see here for more detailed instructions.

And that’s the end of the story! You should now have a fully working Mandala install. For those of you who just accepted the default at all the prompts and didn’t read a thing I wrote above, I will include a summary of important steps you will eventually need to address – perhaps when you are feeling powerful some time…

Important configuration adjustments

1. Open TCP port 5432 on your firewall. Otherwise no external client will be able to speak to the PostgreSQL database. Which kind of defeats the purpose…
2. Change the default postgres user password. Open the installed pgAdmin 3 application, go to “postgres” in Admin roles, and select Properties to find your password change location.
3. Edit your pg_hba.conf file which you will find in the PostgreSQL /data folder. Read this link to find out how to set a range of IP’s permitted to speak with the database.