Installing InfoPage on Debian from scratch

Installing and configuring postgresql

In this example we, create a database called mytestdatabase and grant local access to a "user" called mypsqluser on mytestdatabase. Feel free to change these names.

aptitude install postgresql
echo "local      mytestdatabase  mypsqluser  password" >> /etc/postgresql/8.3/main/pg_hba.conf
Open /etc/postgresql/8.3/main/pg_hba.conf and move that line just above this line:
local   all         postgres                          ident sameuser
After your edits, that part of pg_hba.conf should read like this:
local      mytestdatabase  mypsqluser  password
local   all         postgres                          ident sameuser
The point here is that for a certain database mytestdatabase the username mypsqluser should be able to authenticate against the server, even if mypsqluser does not have a unix account on this computer. Such a setup is preferable to use for integration of apache to postgresql, since it does not require a new user with login possibilities on the server, using the same password as apache does to connect to postgresql.

Now, make postgresql reload its configuration files:

/etc/init.d/postgresql reload
To create a user mypsqluser, do this:
su -s /bin/sh postgres
Now, as user postgres, issue
createuser -DRS mypsqluser
createdb -O mypsqluser mytestdatabase
psql -c "alter USER mypsqluser with password 'pv8D6Z2gnc84ja1'"
exit

If you want a postgresql-user with priviledges to create new databases, use -d rather than -D.

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: oktober 17, 2019