[英]Can't connect to phppgadmin/
I have installed php5, apache2, postgresql, phppgadmin... from the repo on my ovh server, and configured conf.d/phppgadmin for my Ip adress. 我已经从ovh服务器上的存储库中安装了php5,apache2,postgresql,phppgadmin ...,并为我的IP地址配置了conf.d / phppgadmin。
order deny,allow
# deny from all
allow from 192.168.0.47 ::1/128
# allow from all
And when I go to my-server/phppgadmin/ and try to connect myself with the default "postgres" login, without password and with "root" password, I always get the fail connexion message... (Échec de la connexion) 当我转到my-server / phppgadmin /并尝试使用默认的“ postgres”登录名,无密码和“ root”密码连接自己时,总是收到失败的连接消息...(Échecde la connexion)
Yet, I set the line 但是,我设定了界限
$conf['extra_login_security'] = false
in the /etc/phppgadmin/config.inc.php file, to false, but nothing change... 在/etc/phppgadmin/config.inc.php文件中,设置为false,但没有任何变化...
I also create a new user in console: 我还在控制台中创建了一个新用户:
su postgres
createuser myuser
and set a password: 并设置密码:
psql template1
ALTER USER myuser password 'mypassword'
and reboot Postgresql: 并重启Postgresql:
/etc/init.d/postgresql restart
But I still can't connect in phppgadmin/ ! 但是我仍然无法在phppgadmin /中连接!
Big thanks for help, I don't know what's wrong... 非常感谢您的帮助,我不知道怎么了...
If you can access the phppgadmin login page then it's not a problem with your apache config. 如果您可以访问phppgadmin登录页面,则说明您的apache配置没有问题。 Since you get a connection error message I would guess that your Apache is trying to reach the Postgres server at the wrong address.
由于您收到连接错误消息,因此我猜您的Apache正在尝试使用错误的地址访问Postgres服务器。
You have probably set up the database in phppgadmin config using the public IP, try the loopback one (127.0.0.1). 您可能已经使用公共IP在phppgadmin config中设置了数据库,请尝试使用环回之一(127.0.0.1)。
First find file: pg_hba.conf
and edit/add. 首先找到文件
pg_hba.conf
并编辑/添加。 See: "0.0.0.0/0", the responsibility is yours . 参见:“ 0.0.0.0/0”,责任归您所有。
releasing everything can be risky : 0.0.0.0/0 will allow all and all . 释放一切都是有风险的:0.0.0.0/0将允许全部和全部。
"local" is for Unix domain socket connections only “本地”仅适用于Unix域套接字连接
local all all trust
IPv4 local connections: IPv4本地连接:
host all all 0.0.0.0/0 trust
IPv6 local connections: IPv6本地连接:
host all all ::1/128 trust
Second, 第二,
2.1) file: /etc/phppgadmin/config.inc.php
change to $conf['extra_login_security'] = false
2.1)文件:
/etc/phppgadmin/config.inc.php
更改为$conf['extra_login_security'] = false
2.2) 2.2)
If login for UNIX domain socket. 如果登录UNIX域套接字。 don't change:
/etc/phppgadmin/config.inc.php
and execute command: usermod -a -G postgres apache
不要更改:
/etc/phppgadmin/config.inc.php
并执行命令: usermod -a -G postgres apache
If not login _for UNIX domain socket._change it to $conf['servers'][0]['host'] = 'localhost';
如果不是,请登录_for UNIX域套接字。将其更改
$conf['servers'][0]['host'] = 'localhost';
Finally restart Apache and Postgres and it will work. 最后,重新启动Apache和Postgres,它将正常工作。 Access with
进入
user:postgres
pass: NOTHING, no pass.
Once logged in, change the User and Password or the User Add user / password you want. 登录后,更改所需的用户和密码或用户添加用户/密码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.