Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 9, 2005 17:23:43

A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django mod_python and pgsql


I'm trying to get my project working under mod_python but I'm getting
the error:

OperationalError: FATAL: IDENT authentication failed for user "alice"

when attempting to accesshttp://localhost/mysite/This is a postgresql error when trying to access the database as
someone without privileges.

In myproject.settings my db username is 'alice' and the password is ''
- I never specified a password at db creation.

Everything works dandy under the django-admin server under my linux
username 'alice'

The problem is apache is running under a user called 'www-data' and
'www-data' doesn't have access to the database when trying to connect
as 'alice' with password ''

Or so I think. maybe, perhaps...

How can I fix this? I can't quite pin the solution down.


Alice

Offline

#2 Nov. 9, 2005 17:38:10

M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django mod_python and pgsql


Alice wrote:I'm trying to get my project working under mod_python but I'm getting
the error:

OperationalError: FATAL: IDENT authentication failed for user "alice"Hi, Alice!I had this problem and solved it on my Ubuntu Linux. Can't speak forother Linuxes but Postgres from Ubuntu's packages configured by defaultto allow authentication from the same host only by currently loggeduser. To change this edit the file /etc/postgresql/7.4/main/pg_hba.conf(it may of course located in a different place on your machine). Nearthe end there is a line:host all all 127.0.0.1 255.255.255.255ident sameuserchange this 'ident sameuser' to 'password'Then you need to set a password for your user in Postgres. This is donein postgres client (psql) with this SQL command:alter user user_name with password 'password';

(Password should actually be in quotes).

Then restart Postgres and set your db user's credentials in settings.py.

Offline

#3 Nov. 9, 2005 19:10:43

A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django mod_python and pgsql


yup, using Ubuntu. Added a password, changed the line, reboot and it's
still not working.

>configured by default to allow authentication from the same host only by
>currently loggeduser

figured this was the case. Altering the line to 'password' doesn't
change anything however, postgres is still behaving the same ... I
think this is all because of something else.

I'll post here again If I get it working.


Alice

Offline

#4 Nov. 9, 2005 19:14:39

M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django mod_python and pgsql


Alice wrote:yup, using Ubuntu. Added a password, changed the line, reboot and it's
still not working.Ah.. My mistake. You should change 'local' line not the 'host'... Iactually changed both.

Offline

#5 Nov. 9, 2005 19:32:10

A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Django mod_python and pgsql


>You should change 'local' line not the 'host'

heh - and I was just about to reveal my wunnerful fix ;)

>I actually changed both.
I changed all mine too - I don't like the idea of having my db
compromised should my account ever get done-in.

for anyone else who stumbles upon this problem:http://www.postgresql.org/docs/7.3/static/client-authentication.htmlThe Postgres docs are pretty damn thorough


Alice

Offline

Board footer

Moderator control

Enjoy the 20th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support