Mac OS X Lion comes with PostgreSQL installed as default; however it is not running, and not easy to start, you will want to enabled PHP web applications at the same time. There are two ways to start the PostgreSQL service. Either simply by opening Server App and starting the “Wiki” service, or by digging at it via the command line. When you start the Wiki Service. You may want to change the “Wiki Creators” to be Admin’s only or otherwise everybody can create Wikis.

Now PostgreSQL is up and running you will need to make it so it can be used by the server, this requires running through the terminal:

sudo serveradmin stop postgres

sudo nano /System/Library/LaunchDaemons/org.postgresql.postgres.plist

Search for the line:

listen_addresses=

and change it to:

listen_addresses=127.0.0.1

Then restart PostgreSQL

sudo serveradmin start postgres

This means that we now have a working MAPP (Mac, Apache, PostgreSQL, PHP) stack.