bugzilla无法连接到Postgres服务器

用户名

我刚刚在Scientific Linux 6.4版本上安装了bugzilla-4.4.1,但在连接数据库(Pg版本8.4)时遇到问题。

当我尝试获取主页(index.cgi)时,收到以下消息:

软件错误:

Can't connect to the database.
Error: could not connect to server: Permission denied
    Is the server running on host "127.0.0.1" and accepting
    TCP/IP connections on port 5432?
  Is your database installed and up and running?
  Do you have the correct username and password selected in localconfig?

For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

Postgres的pg_hba.conf.conf配置为本地主机上的md5 auth:

host all all 127.0.0.1/32 md5

我可以使用以下命令连接到数据库中的错误用户psql

psql -h 127.0.0.1 -U bugs

运行checksetup.pl似乎可以确认数据库已正确设置和配置:

...剪...

Reading ./localconfig...
Checking for               DBD-Pg (v2.7.0)    ok: found v2.15.1 
Checking for           PostgreSQL (v8.03.0000) ok: found v08.04.1800 

Removing existing compiled templates...
Precompiling templates...done.
Fixing file permissions...

Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.
checksetup.pl complete.
[root@PAHRALBLNX001 bugzilla]# 

并且testserver.pl脚本指示服务器已正确设置:

[root@PAHRALBLNX001 bugzilla]# ./testserver.pl http://127.0.0.1/
TEST-OK Webserver is running under group id in $webservergroup.
TEST-OK Got padlock picture.
TEST-OK Webserver is executing CGIs via mod_cgi.
TEST-OK Webserver is preventing fetch of http://127.0.0.1/localconfig.

我还验证了localconfig中的错误用户名和密码与Postgres中的设置匹配。

然而,一件看起来很奇怪的事情是,当我用Wireshark查看localhost时,在访问bugzilla主页时没有看到尝试连接到PostgreSQL服务器的任何尝试。但是,如果使用来连接到PostgreSQL服务器psql,则可以在Wireshark中看到连接。

编辑

我还发现bugzilla不会发送电子邮件。正如DanielVérité指出的那样,这实际上是一个selinux问题。我将httpd_can_sendmail和httpd_can_network_connect更改为true,现在可以使用了。

丹尼尔·特鲁斯

根据错误消息:

错误:无法连接到服务器:权限被拒绝
服务器是否在主机“ 127.0.0.1”上运行并接受端口5432上的TCP / IP连接?

尝试连接到IP地址时,权限被拒绝,这意味着本地安全策略拒绝了该权限必须启用Web服务器以使用以下命令连接到数据库:

setsebool -P httpd_can_network_connect_db 1

如果还不够:

setsebool -P httpd_can_network_connect 1

有关更多信息,请参见http://wiki.centos.org/TipsAndTricks/SelinuxBooleans

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

bugzilla无法连接到Postgres服务器

来自分类Dev

无法连接到Postgres服务器

来自分类Dev

节点服务器无法连接到postgres db

来自分类Dev

Heroku / Flask / Postgres:无法连接到服务器

来自分类Dev

postgres服务器已启动,但无法连接到服务器

来自分类Dev

无法连接到PostgreSQL服务器

来自分类Dev

无法连接到python服务器

来自分类Dev

Qt无法连接到服务器

来自分类Dev

NullPointerError:无法连接到服务器

来自分类Dev

mongodb无法连接到服务器

来自分类Dev

无法连接到RADIUS服务器

来自分类Dev

无法连接到MySQL服务器

来自分类Dev

无法连接到MQTT服务器

来自分类Dev

XMPPPY无法连接到服务器

来自分类Dev

无法连接到SMTP服务器

来自分类Dev

无法连接到noVNC服务器

来自分类Dev

无法连接到PostgreSQL服务器

来自分类Dev

无法连接到centos服务器

来自分类Dev

无法连接到链接的服务器

来自分类Dev

无法连接到RADIUS服务器

来自分类Dev

RPostgreSQL无法连接到服务器

来自分类Dev

无法连接到 ssh 服务器

来自分类Dev

EvoSuite 无法连接到服务器

来自分类Dev

django postgres 无法连接到服务器:连接被拒绝服务器是否在主机“localhost”(127.0.0.1)上运行

来自分类Dev

Rails-Postgres-无法连接到服务器:连接被拒绝(PG :: ConnectionBad)

来自分类Dev

无法连接到数据库postgres:无法连接到服务器:没有这样的文件或目录

来自分类Dev

postgres_fdw无法连接到Amazon RDS上的服务器

来自分类Dev

无法通过Airflow DAG连接到Docker Postgres服务器

来自分类Dev

无法将服务器上的postgres连接到我本地的postico