Reputation: 67
I've made my django instance accessible on pg_hba.conf. But every morning when I go to get started, I have to re-apply the changes because the file has reset back to its original content.
This is a CentOS7 Server running Apache with cpanel, the django instance is setup with gunicorn and nginx on a separate port from Apache's httpd. I've applied the changes to pg_hba.conf and issued the following commands but they do not fix the issue. sudo systemctl restart postgresql sudo service postgresql restart
here is the code I placed into pg_hba file:
local all all peer
host all all 165.227.123.167/32 md5
host all all ::1/128 md5
#That code successfully allows access to database once applied to file and this command following:
sudo systemctl restart postgresql
I expected the change to be permanent, but it actually needs to be done daily.
Upvotes: 1
Views: 688
Reputation: 159
When you edit the pg_hba file close it. Restart your postgres service. It'll work.
For security purpose you cant see pg_hba file content.
Upvotes: 0