pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
trouble connecting to Postgresql Database via apache-perl script on localhost ? pg_hba.conf issue
3+ messages / 2 participants
[nested] [flat]

* trouble connecting to Postgresql Database via apache-perl script on localhost ? pg_hba.conf issue
@ 2003-04-08 07:11  mlaks <mlaks@bellatlantic.net>
  0 siblings, 1 reply; 3+ messages in thread

From: mlaks @ 2003-04-08 07:11 UTC (permalink / raw)
  To: pgsql-admin

Hi,
I am trying to do simple adminstration tasks on a postgresql database on 
the localhost via my apache server and a cgi-perlscript.
The perlscript by itself works fine and connects to the database as 
the user "wustl". It uses Perl DBI to talk to the database.
But it wont work with apache i get error messages on my pg database
such as 

bash-2.05a$ 
FATAL 1:  IDENT authentication failed for user "nobody"

or

FATAL 1:  IDENT authentication failed for user "wustl"
pg_ctl s

whether i use the name "wustl" (the creator of the database) or 
"nobody" (in a fit of hubris and insanity i tried ot let "nobody" be a 
superuser on postgresql

I cant figure out how to set up the pg_hba.conf file to work.
I have tried using the settings

#####
local   all     ident   sameuser
host    all     127.0.0.1       255.255.255.255 trust
#######

or 

#########
local   all     ident   sameuser
host    all     127.0.0.1       255.255.255.255  ident sameuser

#######

the connection string of my perlscript was

my $conn = DBI->connect
    ("DBI:Pg:dbname=LTA_IDB","wustl","")
   or die("Cannot connect: $DBI::errstr");
 $patname = $conn->quote( $patname);

or

my $conn = DBI->connect
    ("DBI:Pg:dbname=LTA_IDB","nobody","")
   or die("Cannot connect: $DBI::errstr");
 $patname = $conn->quote( $patname); 

depending upon my try.

thanks

Mitchell Laks




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: trouble connecting to Postgresql Database via apache-perl script on localhost ? pg_hba.conf issue
@ 2003-04-08 11:39  mlaks <mlaks@bellatlantic.net>
  parent: mlaks <mlaks@bellatlantic.net>
  0 siblings, 1 reply; 3+ messages in thread

From: mlaks @ 2003-04-08 11:39 UTC (permalink / raw)
  To: pgsql-admin

Hi i also enabled 
tcpip_socket = true
in the postgresql.conf file as well, and did a pg_ctl reload or pg_ctl 
stop/pg_ctl start to no avail :(.
i am running redhat 7.3 with the default postgresql install of 
postgresql-7.2.1-5.

thank you
mitchell
On Tuesday 08 April 2003 03:11 am, you wrote:
> Hi,
> I am trying to do simple adminstration tasks on a postgresql database on
> the localhost via my apache server and a cgi-perlscript.
> The perlscript by itself works fine and connects to the database as
> the user "wustl". It uses Perl DBI to talk to the database.
> But it wont work with apache i get error messages on my pg database
> such as
>
> bash-2.05a$
> FATAL 1:  IDENT authentication failed for user "nobody"
>
> or
>
> FATAL 1:  IDENT authentication failed for user "wustl"
> pg_ctl s
>
> whether i use the name "wustl" (the creator of the database) or
> "nobody" (in a fit of hubris and insanity i tried ot let "nobody" be a
> superuser on postgresql
>
> I cant figure out how to set up the pg_hba.conf file to work.
> I have tried using the settings
>
> #####
> local   all     ident   sameuser
> host    all     127.0.0.1       255.255.255.255 trust
> #######
>
> or
>
> #########
> local   all     ident   sameuser
> host    all     127.0.0.1       255.255.255.255  ident sameuser
>
> #######
>
> the connection string of my perlscript was
>
> my $conn = DBI->connect
>     ("DBI:Pg:dbname=LTA_IDB","wustl","")
>    or die("Cannot connect: $DBI::errstr");
>  $patname = $conn->quote( $patname);
>
> or
>
> my $conn = DBI->connect
>     ("DBI:Pg:dbname=LTA_IDB","nobody","")
>    or die("Cannot connect: $DBI::errstr");
>  $patname = $conn->quote( $patname);
>
> depending upon my try.
>
> thanks
>
> Mitchell Laks
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: trouble connecting to Postgresql Database via
@ 2003-04-09 19:56  Robert Treat <xzilla@users.sourceforge.net>
  parent: mlaks <mlaks@bellatlantic.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Robert Treat @ 2003-04-09 19:56 UTC (permalink / raw)
  To: mlaks <mlaks@bellatlantic.net>; +Cc: pgsql-admin

You've not given us all the information, since if you set your
pg_hba.conf to use "trust" based authentication, you wont get a "FATAL:
IDENT" type error message. Go back to trust, restart your database, try
and connect and post back if it doesn't work.  If it does work, check
the docs RE: setting up IDENT authentication. IIRC your going to need a
password supplied in your perl code, and I didn't see one...

Robert Treat 

On Tue, 2003-04-08 at 07:39, mlaks wrote:
> Hi i also enabled 
> tcpip_socket = true
> in the postgresql.conf file as well, and did a pg_ctl reload or pg_ctl 
> stop/pg_ctl start to no avail :(.
> i am running redhat 7.3 with the default postgresql install of 
> postgresql-7.2.1-5.
> 
> thank you
> mitchell
> On Tuesday 08 April 2003 03:11 am, you wrote:
> > Hi,
> > I am trying to do simple adminstration tasks on a postgresql database on
> > the localhost via my apache server and a cgi-perlscript.
> > The perlscript by itself works fine and connects to the database as
> > the user "wustl". It uses Perl DBI to talk to the database.
> > But it wont work with apache i get error messages on my pg database
> > such as
> >
> > bash-2.05a$
> > FATAL 1:  IDENT authentication failed for user "nobody"
> >
> > or
> >
> > FATAL 1:  IDENT authentication failed for user "wustl"
> > pg_ctl s
> >
> > whether i use the name "wustl" (the creator of the database) or
> > "nobody" (in a fit of hubris and insanity i tried ot let "nobody" be a
> > superuser on postgresql
> >
> > I cant figure out how to set up the pg_hba.conf file to work.
> > I have tried using the settings
> >
> > #####
> > local   all     ident   sameuser
> > host    all     127.0.0.1       255.255.255.255 trust
> > #######
> >
> > or
> >
> > #########
> > local   all     ident   sameuser
> > host    all     127.0.0.1       255.255.255.255  ident sameuser
> >
> > #######
> >
> > the connection string of my perlscript was
> >
> > my $conn = DBI->connect
> >     ("DBI:Pg:dbname=LTA_IDB","wustl","")
> >    or die("Cannot connect: $DBI::errstr");
> >  $patname = $conn->quote( $patname);
> >
> > or
> >
> > my $conn = DBI->connect
> >     ("DBI:Pg:dbname=LTA_IDB","nobody","")
> >    or die("Cannot connect: $DBI::errstr");
> >  $patname = $conn->quote( $patname);
> >
> > depending upon my try.
> >
> > thanks
> >
> > Mitchell Laks
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-04-09 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-08 07:11 trouble connecting to Postgresql Database via apache-perl script on localhost ? pg_hba.conf issue mlaks <mlaks@bellatlantic.net>
2003-04-08 11:39 ` mlaks <mlaks@bellatlantic.net>
2003-04-09 19:56   ` Re: trouble connecting to Postgresql Database via Robert Treat <xzilla@users.sourceforge.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox