Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24th June 2012, 05:34 AM
Doug Hutcheson Offline
Registered User
 
Join Date: Jun 2009
Location: Queensland
Posts: 131
linuxfirefox
Postgresql not accepting user Apache after upgrade

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.
Reply With Quote
  #2  
Old 24th June 2012, 10:52 AM
kordirko Offline
Registered User
 
Join Date: Jun 2012
Location: Poland
Posts: 3
linuxfirefox
Re: Postgresql not accepting user Apache after upgrade

local all all peer is for connections throught sockets,
but the error message says, that your script is trying to connect throught the localhost

Try to edit pg_hba.conf and change this line:
Code:
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
Reply With Quote
  #3  
Old 25th June 2012, 12:06 AM
Doug Hutcheson Offline
Registered User
 
Join Date: Jun 2009
Location: Queensland
Posts: 131
linuxfirefox
Re: Postgresql not accepting user Apache after upgrade

Quote:
Originally Posted by kordirko View Post
Code:
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
Thank you, kordirko. I was looking in the wrong place, which is not surprising, considering that I was doing this for the first time <grin>. Changing IPv4 by itself did not work: I had to do the same to the IPv6 connections line as well. Everything is working fine now.
Reply With Quote
Reply

Tags
accepting, apache, postgresql, upgrade, user

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postgresql problem after upgrade F16 to F17 reader69 Using Fedora 2 11th July 2012 10:58 AM
[Q] FC4 - PostgreSQL Data Upgrade TheEdge Servers & Networking 0 28th June 2005 11:17 AM
PostgreSQL unable to start after last upgrade fjleal Servers & Networking 0 18th December 2004 03:04 PM


Current GMT-time: 06:35 (Sunday, 26-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat