0

我有fedora 21,我想使用phpPgAdmin 访问postgresql db。为此,我也安装了 httpd 和 phppgadmin,postgresql。
例如,我可以毫无问题地登录到 pgql

psql -U learning -W template1

或者

psql -W template1

但是当我输入 localhost/phpPgAdmin 时,我无法登录尝试登录之间的差异

> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "POST /phpPgAdmin/redirect.php HTTP/1.1" 200 2268 "http://localhost/phpPgAdmin/redirect.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/browser.php HTTP/1.1" 200 3005 "http://localhost/phpPgAdmin/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/themes/default/global.css HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/libraries/js/jquery.js HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/xloadtree/xtree2.js HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/themes/global.css HTTP/1.1" 304 - "http://localhost/phpPgAdmin/themes/default/global.css" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/xloadtree/xloadtree2.js HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/title.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/Refresh.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/Servers.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/L.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/Loading.gif HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/I.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/servers.php?action=tree HTTP/1.1" 200 275 "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
> 127.0.0.1 - - [04/Mar/2015:17:44:27 +0100] "GET /phpPgAdmin/images/themes/default/DisconnectedServer.png HTTP/1.1" 304 - "http://localhost/phpPgAdmin/browser.php" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"

我的 /var/lib/pgsql/data/pg_hba.conf 是

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
host    all             all             192.168.1.0/24          ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident

我的 /etc/phpPgAdmin/config.inc.php

$conf['extra_login_security'] = false;

这是据我所知如何使它工作,但我不知道如何做到这一点 phpPgAdmin 在失败登录时告诉我“Próba zalogowania nie powiodła się。”,这可能类似于“尝试登录失败”

localhost/phpMyAdmin 工作正常

我能以某种方式得到我没有登录的原因吗?密码错误,没有服务器等?

解决方案我走得很简单,重新安装了 Fedora,现在一切正常,但这实际上不是一个解决方案:P

4

1 回答 1

0

尝试这个。

如果这是您访问计算机的 IP 地址范围,请更改

host    all             all             192.168.1.0/24          ident

对此

host    all             all             192.168.1.0/24          trust

更改后重新加载 Postgres。看看能不能登陆。

您可能还需要通过在 postgres conf 中更改它来启用网络。

listen_addresses='localhost'

listen_addresses='*' 

还要确保您已授予用户所有适当的权限,以便能够访问该数据库或您想要管理的任何数据库。

编辑:

可能是 SELinux 问题。您可以使用此命令暂时关闭 SELinux 进行测试。

setenforce 0

然后测试登录,看看它是否有效。如果它确实有效,这意味着 selinux 正在阻止访问,您应该运行此命令以允许 httpd 在重新启动后继续工作。

setsebool -P httpd_can_network_connect_db 1
于 2015-03-04T17:54:05.263 回答