Setup Accounting Database

From JonDonym Wiki
(Difference between revisions)
Jump to: navigation, search
(Setup Accounting Database)
Line 1: Line 1:
 
[[Category:MixOpLinux]] [[Category:MixOpFreeBSD]]
 
[[Category:MixOpLinux]] [[Category:MixOpFreeBSD]]
 +
<iimg>[[Setup Accounting Database]]![[Image:en.png]]</iimg><iimg>[[Setup der Accounting Datenbank]]![[Image:de.png]]</iimg>
 
== Setup Accounting Database ==
 
== Setup Accounting Database ==
 
If you run pay Mixes, you moreover have to initialise the postgres database. It is only needed for the first Mix. However, you do not know if you may not switch position some time, and therefore also other Mixes should do that.  
 
If you run pay Mixes, you moreover have to initialise the postgres database. It is only needed for the first Mix. However, you do not know if you may not switch position some time, and therefore also other Mixes should do that.  

Revision as of 15:34, 23 March 2010

File:En.png File:De.png

Setup Accounting Database

If you run pay Mixes, you moreover have to initialise the postgres database. It is only needed for the first Mix. However, you do not know if you may not switch position some time, and therefore also other Mixes should do that.

First switch to user postgres.

su postgres

Afterwards create the new user aiuser and the accounting database.

createuser -A -D aiuser
createdb -O aiuser aidb

Login into the database environment as user postgres, set the password for aiuser and leave the database environment.

psql -d aidb
alter user aiuser with password 'PASSWORD';
\q

Edit the postgres configuration file pg_hba.conf located somewhere in /etc/postgresql and allow connections with password. Replace the commands there that enforce ident or md5 login. Note that Postgres looks only for the first line matching a connection type, so don't insert several lines for the same connection type.

# All other connections by UNIX sockets
local all all password
# All IPv4 connections from localhost
host all all 127.0.0.1 255.255.255.255 ident passwordş

Restart postgres after configuration changes:

/etc/init.d/postgresql restart

Fill the accounting database with the accounting tables. The mix source tree contains the SQL file mixtables.sql with all instructions.

psql -U aiuser -d aidb < /home/mix/stable/mixtables.sql

Login as aiuser with your password and check if you see the created tables or not... If you do, everything is OK!

psql -U aiuser -d aidb 
\dt
\q 
Personal tools