Mailing List Archive

Changes to create-database.sh that allow for remote host creation
Hi everyone,

first of all thank you for the great software. I was looking for
something that I could use to sync my Android phone with, well
something that I did not choose yet ;-) .

While attempting to create the database I noticed that the
create-database.sh script requires to be run on the database machine
and requires that awl stuff which I only have on my apache machine. So
basically my setup consists of several Xen domains where I have one for
the database and one for apache. Therefore I could not use the script
to easily create the database. So I modified it and it should work fine
now, there are two new parameters to use: the host and the username of
the creating user (davi). In addition you also need the following
pg_hba.conf entries:

trust host davical davical_dba SRC_IP 255.255.255.255 trust
host davical davi SRC_IP 255.255.255.255 trust host

host davical davical_app SRC_IP 255.255.255.255
template1 davi SRC_IP 255.255.255.255 trust
host postgres davi SRC_IP 255.255.255.255 trust

SRC_IP stands for the IP ouf your Apache machine.

The first two lines are mentioned in the wiki. But for the script to
succeed from remote you need access to the template1 and the postgres
database. I do not remember for which part of the script you need the
3rd line cause it was a messy trial'n'error game. (Disclaimer: I am not
a pro in postgresql setup and bash scripting)

In order to work one must also create the davi user on the database
machine using createuser as postgres user. I gave it full superuser
rights as you can remove this user and the respective line from the
pg_hba.conf after installation.

Hopefully this is useful to anyone else and perhaps someone can verify
whether it still works with local connections.

I did not enter it into the wiki, cause it is highly untested.

Regards,
Marek