Database settings
Canopy stores it's DB configuration in /etc/canopy/canopy.ini under the DATABASE_URL setting.
The settings takes the format of an URI e.g. postgres://username:password@hostname/databasename
It can be tested via: canopy-manage testdb (Only available from Canopy 3.0.3)
Note:
Canopy's processes should be restarted if any settings in that file is changed or if the database is restarted!
Canopy can be restarted via: supervisorctl restart all
File locations are for Ubuntu and might be slightly different for RHEL based distrubutions
Postgresql
Please consider the steps provided as only a guideline and refer to the official documentation for authoritative information: https://www.postgresql.org/docs/9.5/static/index.html
Changing canopy DB user's password:
- As root, execute: sudo -u postgres psql
- In the psql client execute: ALTER ROLE canopy WITH PASSWORD 'the new password';
- Change the DATABASE_URL in /etc/canopy/canopy.ini to be the same
- Test access via: canopy-manage testdb
- Restart Canopy
If the DB will be exposed to the network then a strong password should be assigned.
Changing host-based access control:
By default only local processes can connect to Postgresql via a file socket or over the loopback interface. If you intend to expose the DB to the network then additional access needs to be granted.
To add an additional host/network to Postges's host-based access control:
- Open /etc/postgresql/9.5/main/pg_hba.conf
- Add a line similar to the follow but with the appropriate IP address:
host canopy canopy 192.168.0.5/32 md5
Restart postgresql: service postgresql restart
Test access via: canopy-manage testdb
Restart Canopy
Changing DB listening interfaces:
By default postgres only listens on localhost and a file socket. To change the addresses it listens on:
- As root, edit the listen_addresses variable in /etc/postgresql/9.5/main/postgresql.conf
Restart postgresql: service postgresql restart
Test access via: canopy-manage testdb
Restart Canopy
For more information see the official documentation: https://www.postgresql.org/docs/9.5/static/runtime-config-connection.html