TwoServerSetup

The setup of the infrastructure with one CAS application server (Backend) and one separated dedicated DB server(DB) with PostgreSQL.

We asssume that PostgreSQL has been already installed on machine DB. Let's assume also that the IP address of the Backend is 195.208.a.b and the IP address of the DB is 212.192.x.y

After that we need to setup the connection between the Backend and BD.

  • First we put in the pg_hba.conf of the DB the following line
host    cas         cas_user      195.208.a.b/32     md5
  • After that we should enable the listening of the TCP socket by PostgreSQL. To do that we should uncomment and correct the following lines in postgresql.conf
listen_addresses = '212.192.x.y'                                         
port = 5432
  • After that we should create the user who will work with CAS and setup his password:
postgres@xxx:~$ createuser -P cas_user
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
CREATE ROLE
  • Now we will create the DB, setup the permissions for cas_user
postgres@xxxx:~$ createdb cas
CREATE DATABASE
postgres@xxxx:~$ psql cas
cas=# grant CREATE on database cas to cas_user;
GRANT
  • Reload the config files by doing:
killall -SIGHUP postmaster
  • Now we can connect from the Backend machine to the DB server
math@aaaa: psql -h 212.192.x.y -U cas_user cas
Password: 
Welcome to psql 8.1devel, the PostgreSQL interactive terminal.
....


The IP of the DB (212.192.x.y), the name of database "cas"", the name of the user "cas_user" and the password which we entered here will be used in setting up the JNDI connection source for Tomcat (that information will be in the context.xml of Axis)