NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

After I installed nominatim when I access http://localhost/nominatim/search.php I get

string(19) "pgsql://@/nominatim" object(DB_Error)#2 (8) { ["error_message_prefix"]=> string(0) "" ["mode"]=> int(1) ["level"]=> int(1024) ["code"]=> int(-24) ["message"]=> string(24) "DB Error: connect failed" ["userinfo"]=> string(141) " [nativecode=pg_connect(): Unable to connect to PostgreSQL server: FATAL: role "www-data" is not permitted to log in]

This deals with www-data role on postrges. But on install I trowed:

psql -U postgres -c 'create role "www-data"'; psql -U postgres -d nominatim -c 'GRANT ALL PRIVILEGES ON DATABASE nominatim TO "www-data"';

Any clue?

asked 01 Feb '13, 19:04

mihai%20niculita's gravatar image

mihai niculita
16222
accept rate: 0%


I manged to resolve it by trowing:

psql -U postgres -c 'ALTER ROLE "www-data" WITH login;';

So i problem of PostGreSQL role creation.

permanent link

answered 01 Feb '13, 20:22

mihai%20niculita's gravatar image

mihai niculita
16222
accept rate: 0%

2

Having "www-data" as a database user raises warning signs to me.

Remember that postgres users and system users are completely distinct. Your application (nominatim) should have a option to configure which database user is used to connect to the db. If the app doesn't specify anything, the current system user name is used to (try to) connect to the db.

www-data is typically the system user that runs the web server. It should not, as a whole, be allowed to connect to the db, for security and maintenance reasons.

(04 Feb '13, 09:00) Vincent de P... ♦
1

(continued) Create a "nominatim" db user instead (maybe one exists already), give it access to just your nominatim db, and configure nominatim to use that user when connecting.

(04 Feb '13, 09:04) Vincent de P... ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×7

question asked: 01 Feb '13, 19:04

question was seen: 12,197 times

last updated: 04 Feb '13, 09:04

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum