我已经让我的 django 实例可以在 pg_hba.conf 上访问。但是每天早上开始时,我必须重新应用更改,因为文件已重置回其原始内容。
这是一个使用 cpanel 运行 Apache 的 CentOS7 服务器,django 实例使用 gunicorn 和 nginx 设置在与 Apache 的 httpd 不同的端口上。我已将更改应用到 pg_hba.conf 并发出以下命令,但它们不能解决问题。sudo systemctl restart postgresql sudo service postgresql restart
这是我放入 pg_hba 文件的代码:
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
我预计更改是永久性的,但实际上需要每天进行。