登录在nginx centos中失败了PhpPgAdmin

时间:2016-12-06 21:52:58

标签: nginx centos

我在phpPgAdmin登录的centos中面临奇怪的问题,我做了所有必需的事情

in ** /usr/share/phpPgAdmin/conf/config.inc.php **

 $conf['extra_login_security'] = false;

我尝试了两种配置组合 在 /var/lib/pgsql/9.3/data/pg_hba.conf

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:


host    all             all             127.0.0.1/32           trust

# IPv6 local connections:
host    all             all             ::1/128                trust
host    all             all             myserver_ip/32       trust

=========================第二===================== ================

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:


host    all             all             127.0.0.1/32           md5

# IPv6 local connections:
host    all             all             ::1/128                md5
host    all             all             myserver_ip/32       md5

但是登录失败仍然存在

2 个答案:

答案 0 :(得分:0)

这两个pg_hba.conf设置中的任何一个都应该可以正常工作,尽管第一个设置更有可能(尽管完全不安全)。您似乎从问题描述中遗漏的一件事是,如果您修改/usr/share/phpPgAdmin/conf/config.inc.php中的服务器配置行。必须更新这些数据库以指向您的数据库服务器(并且根据它是本地数据库还是远程数据库而不同)。

如果没有这样做,我建议去PostgreSQL松弛团队或Freenode上的#postgresql,以获得实时故障排除帮助。

答案 1 :(得分:0)

1。配置防火墙

done

2。如下配置SELinux:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-port=5432/tcp
sudo firewall-cmd --reload

3。配置PostgreSQL

sudo vi /var/lib/pgsql/data/pg_hba.conf

sudo setsebool -P httpd_can_network_connect on
sudo setsebool -P httpd_can_network_connect_db on

4。设置PostgreSQL监听地址:

sudo vi /var/lib/pgsql/data/postgresql.conf

IPv4 local connections:
host    all             all             127.0.0.1/32            md5
IPv6 local connections:
host    all             all             ::1/128                 md5

然后配置phpPgAdmin

sudo vi /etc/httpd/conf.d/phpPgAdmin.conf

listen_addresses = '*'
port = 5432