I have a Perl CGI script that connects to my Postgresql database. It was working when I was running Fedora 15, but now that I have upgraded to FC16, the script cannot connect.
In the Perl script, I use CGI:
Code:
use CGI qw(:standard);
use CGI::Pretty;
My connection string is:
Code:
my $dbh = DBI->connect("DBI:Pg:dbname=softwarebiz;host=localhost", "apache", "apache", {'RaiseError' => 1});
This worked fine under FC15, but under FC16 I am getting access errors:
Code:
[Sun Jun 24 13:23:01 2012] [error] [client ::1] DBI connect('dbname=softwarebiz;host=localhost','apache',...) failed: FATAL: Ident authentication failed for user "apache" at /var/www/cgi-bin/database.cgi line 34, referer: http://localhost/
Thinking it was a problem with /var/lib/pgsql/data/pg_hba.conf, I edited the line
local all all peer
to read
local all all trust
and forced a restart of the postgresql service, but the system still complains about Ident authentication failure when I run the cgi script. I thought the change from 'peer' to 'trust' bypassed the Ident requirement, but I really know nothing about it.
User apache/group apache exists on my machine, with login shell '/sbin/nologin' and home directory /var/www. I have used the postgres user to set apache's PostgreSQL password to apache again, although that is what it was already under FC15.
I am probably missing something basic and would appreciate any help.