Res: Re: Res: Re: Res: Re: [UMN_MAPSERVER-USERS] Res: Re: [UMN_MAPSERVER-USERS] Res: Re: Res: Re: [UMN_MAPSERVER-USERS] Fw: Postgis Connection

Benjamin Thelen bt at CCGIS.DE
Fri Jul 1 07:04:51 PDT 2005


Ezequias Rodrigues da Rocha wrote:
>  
>  
> /-------Mensagem original-------/
>  
> /*De:*/ Benjamin Thelen <mailto:bt at ccgis.de>
> /*Data:*/ 07/01/05 10:02:54
> /*Para:*/ Ezequias Rodrigues da Rocha <mailto:ezequias at recife.pe.gov.br>
> /*Cc:*/ MAPSERVER-USERS at LISTS.UMN.EDU <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
> /*Assunto:*/ Re: Res: Re: Res: Re: [UMN_MAPSERVER-USERS] Res: Re: 
> [UMN_MAPSERVER-USERS] Res: Re: Res: Re: [UMN_MAPSERVER-USERS] Fw: 
> Postgis Connection
>  
> Ezequias Rodrigues da Rocha wrote:
>  > lets be clear.
>  >
>  > The postgresl user postgres have the pass=post
>  > The linux postgres user have the pass=' ' (blank)
>  >
>  > I only can access the postgres user by linux exiting the root sesstion
>  > (su - postgres)
>  >
>  > Some other person set the passwords for me.
>  >
>  > This make any suggestion ?
>  >
>  > Best regards
>  > Ezequias
>  >
>  >
>  > /-------Mensagem original-------/
>  >
>  > /*De:*/ Benjamin Thelen <mailto:bt at ccgis.de>
>  > /*Data:*/ 07/01/05 09:29:44
>  > /*Para:*/ Ezequias Rodrigues da Rocha <mailto:ezequias at recife.pe.gov.br>
>  > /*Cc:*/ MAPSERVER-USERS at LISTS.UMN.EDU 
> <mailto:MAPSERVER-USERS at LISTS.UMN.EDU> 
> <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  > /*Assunto:*/ Re: Res: Re: [UMN_MAPSERVER-USERS] Res: Re:
>  > [UMN_MAPSERVER-USERS] Res: Re: Res: Re: [UMN_MAPSERVER-USERS] Fw:
>  > Postgis Connection
>  >
>  > Ezequias Rodrigues da Rocha wrote:
>  >  > Some other thing.
>  >  >
>  >  > The server doesn't have the "postgres" user (linux system).
>  >  >
>  >  > The user "postgres" is from the postgresql.
>  >  >
>  >  > I hope you understands what I means.
>  >  >
>  >  > Best regards
>  >  > Ezequias
>  >  >
>  >  > /-------Mensagem original-------/
>  >  >
>  >  > /*De:*/ Benjamin Thelen <mailto:bt at CCGIS.DE>
>  >  > /*Data:*/ 07/01/05 09:02:12
>  >  > /*Para:*/ MAPSERVER-USERS at LISTS.UMN.EDU 
> <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  > /*Assunto:*/ Re: [UMN_MAPSERVER-USERS] Res: Re: [UMN_MAPSERVER-USERS]
>  >  > Res: Re: Res: Re: [UMN_MAPSERVER-USERS] Fw: Postgis Connection
>  >  >
>  >  > Ezequias Rodrigues da Rocha wrote:
>  >  >  > All looks to be correct. I am becoming to be worried.
>  >  >  >
>  >  >  > ps: Your e-mails are comming twice. Some times three times. Check
>  > it out.
>  >  >  >
>  >  >  > Thank you for your attention
>  >  >  >
>  >  >  > Sincerely
>  >  >  > ezequias
>  >  >  >
>  >  >  > /-------Mensagem original-------/
>  >  >  >
>  >  >  > /*De:*/ Benjamin Thelen <mailto:bt at CCGIS.DE>
>  >  >  > /*Data:*/ 07/01/05 08:16:01
>  >  >  > /*Para:*/ MAPSERVER-USERS at LISTS.UMN.EDU 
> <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  >  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  >  > /*Assunto:*/ Re: [UMN_MAPSERVER-USERS] Res: Re: Res: Re:
>  >  >  > [UMN_MAPSERVER-USERS] Fw: Postgis Connection
>  >  >  >
>  >  >  > Ezequias Rodrigues da Rocha wrote:
>  >  >  >  > I do heve this line. See below:
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >
>  >  >  >
>  >  >
>  > 
> #---------------------------------------------------------------------------
>  >  >  >  > # CONNECTIONS AND AUTHENTICATION
>  >  >  >  >
>  >  >  >
>  >  >
>  > 
> #---------------------------------------------------------------------------
>  >  >  >  >
>  >  >  >  > # - Connection Settings -
>  >  >  >  >
>  >  >  >  > listen_addresses = '*'  # what IP interface(s) to listen on;
>  >  >  >  >                                 # defaults to localhost, '*' 
> = any
>  >  >  >  > port = 5432
>  >  >  >  > max_connections = 100
>  >  >  >  >
>  >  >  >  > Still waitting
>  >  >  >  > Ezequias
>  >  >  >  >
>  >  >  >  > /-------Mensagem original-------/
>  >  >  >  >
>  >  >  >  > /*De:*/ Benjamin Thelen <mailto:bt at ccgis.de>
>  >  >  >  > /*Data:*/ 07/01/05 05:55:31
>  >  >  >  > /*Para:*/ Ezequias Rodrigues da Rocha
>  >  > <mailto:ezequias at recife.pe.gov.br>
>  >  >  >  > /*Cc:*/ Benjamin Thelen <mailto:bt at ccgis.de>
>  >  >  >  > /*Assunto:*/ Re: Res: Re: [UMN_MAPSERVER-USERS] Fw: Postgis
>  > Connection
>  >  >  >  >
>  >  >  >  > Ezequias Rodrigues da Rocha wrote:
>  >  >  >  >  > I didn't find the tcpip_socket parameter and put it in sume
>  > point
>  >  >  > on my
>  >  >  >  >  > postgresql.conf.
>  >  >  >  >  >
>  >  >  >  >  > But now I can't start my postgresql 8.0 (# ./postmaster -D
>  >  >  >  >  > /usr/local/pgsql/data)
>  >  >  >  >  >
>  >  >  >  >  > Please see what is wrong
>  >  >  >  >  >
>  >  >  >  >  > The error reported was:
>  >  >  >  >  >
>  >  >  >  >  > [postgres at mangueira bin]$ FATAL:  unrecognized configuration
>  >  > parameter
>  >  >  >  >  > "tcpip_socket"
>  >  >  >  >  >
>  >  >  >  >  > My pg_hba.conf is:
>  >  >  >  >  >
>  >  >  >  >  > [postgres at mangueira data]$ more pg_hba.conf
>  >  >  >  >  > # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
>  >  >  >  >  >
>  >  >  >  >  > # "local" is for Unix domain socket connections only
>  >  >  >  >  > local   all         all                               trust
>  >  >  >  >  > # IPv4 local connections:
>  >  >  >  >  > host    all         all         10.0.0.0 
> 255.0.0.0    password
>  >  >  >  >  > host    all         all         192.168.0.0 255.0.0.0 
> password
>  >  >  >  >  > host    all         all         127.0.0.1/32          trust
>  >  >  >  >  > host    all         all         200.249.133.135 
> 255.255.255.255
>  >  >  >  >  > password
>  >  >  >  >  > # IPv6 local connections:
>  >  >  >  >  > host    all         all         ::1/128               trust
>  >  >  >  >  > I believe there is no problem because I am on the network 10
>  >  > and the
>  >  >  >  >  > server on the 192
>  >  >  >  >  >
>  >  >  >  >  > Some more advices ?
>  >  >  >
>  >  >  >
>  >  >  > Ezequias,
>  >  >  >
>  >  >  > You can ping the pgsql-server from your mapserver-server?
>  >  >  > # ping lab1.recife
>  >  >  >
>  >  >  > The pgsql-server listens on port 5432? Check with:
>  >  >  > # netstat -tan -ptcp.
>  >  >  >
>  >  >  > You corrected the typo "dbname=dbpotgis"?
>  >  >  > You are sure about the password for the dbuser? Can you log 
> into the
>  >  >  > database from the command line and access the tables?
>  >  >  > # psql -Upostgres -ddbpostgis
>  >  >  >
>  >  >  > If you are not sure about the password, change "password" to
>  > "trust" in
>  >  >  > pg_hba.conf. Also, I would recommend to change "password" to 
> "md5" for
>  >  >  > encrypted passwords.
>  >  >  >
>  >  >  >
>  >  >  > Well, at the moment, I have no more ideas, sorry!
>  >  >  >
>  >  >  > Ben
>  >  >  >
>  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > Best regards
>  >  >  >  >  > Ezequias
>  >  >  >  >  >
>  >  >  >  >  > /-------Mensagem original-------/
>  >  >  >  >  >
>  >  >  >  >  > /*De:*/ Benjamin Thelen <mailto:bt at CCGIS.DE>
>  >  >  >  >  > /*Data:*/ 06/30/05 12:43:52
>  >  >  >  >  > /*Para:*/ MAPSERVER-USERS at LISTS.UMN.EDU 
> <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  >  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  >  >  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  >  >  >  > <mailto:MAPSERVER-USERS at LISTS.UMN.EDU>
>  >  >  >  >  > /*Assunto:*/ Re: [UMN_MAPSERVER-USERS] Fw: Postgis Connection
>  >  >  >  >  >
>  >  >  >  >  > Ezequias Rodrigues da Rocha wrote:
>  >  >  >  >  >  > I am trying to load a mapserver service with a postgis
>  >  >  > connection but
>  >  >  >  >  >  > the MS reported this message below:
>  >  >  >  >  >  >
>  >  >  >  >  >  >
>  >  >  >  >  >  > msDrawMap(): Image handling error. Failed to draw 
> layer named
>  >  >  >  > 'bairros'.
>  >  >  >  >  >  > msPOSTGISLayerOpen(): Query error. couldnt make 
> connection to
>  >  >  > DB with
>  >  >  >  >  >  > connect string 'user=postgres password=post 
> dbname=dbpotgis
>  >  >  >  >  >  > host=lab1.recife port=5432'.
>  >  >  >  >  >  > Error reported was 'could not create socket: Permission
>  >  > denied '.
>  >  >  >  >  >  > This error occured when trying to make a connection to the
>  >  >  > specified
>  >  >  >  >  >  > postgresql server.
>  >  >  >  >  >  > Most commonly this is caused by
>  >  >  >  >  >  > (1) incorrect connection string
>  >  >  >  >  >  > (2) you didnt specify a 'user=...' in your connection 
> string
>  >  >  >  >  >  > (3) the postmaster (postgresql server) isnt running
>  >  >  >  >  >  > (4) you are not allowing TCP/IP connection to the 
> postmaster
>  >  >  >  >  >  > (5) your postmaster is not running on the correct port -
>  > if its
>  >  >  > not on
>  >  >  >  >  >  > 5432 you must specify a 'port=...'
>  >  >  >  >  >  > (6) the security on your system does not allow the 
> webserver
>  >  >  > (usually
>  >  >  >  >  >  > user 'nobody') to make socket connections to the 
> postmaster
>  >  >  >  >  >  > (7) you forgot to specify a 'host=...' if the postmaster
>  > is on a
>  >  >  >  >  >  > different machine
>  >  >  >  >  >  > (8) you made a typo
>  >  >  >  >  >  > Does anyone can tell me what to do  ?
>  >  >  >  >  >  >
>  >  >  >  >  >  >
>  >  >  >  >  >  >
>  >  >  >  >
>  >  > 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>  >  >  >  >  >  >                                   Atenciosamente 
> (Sincerely)
>  >  >  >  >  >  >                         *Ezequias Rodrigues da Rocha*
>  >  >  >  >  >  >                                 *** 
> *www.recife.pe.gov.br <http://www.recife.pe.gov.br>
>  > <http://www.recife.pe.gov.br>
>  >  > <http://www.recife.pe.gov.br>
>  >  >  > <http://www.recife.pe.gov.br>
>  >  >  >  > <http://www.recife.pe.gov.br>
>  >  >  >  >  > <http://www.recife.pe.gov.br>*
>  >  >  >  >  >  > <http://www.recife.pe.gov.br/>
>  >  >  >  >  >  >
>  >  >  >  >
>  >  > 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>  >  >  >  >  >  > A pior das democracias ainda é melhor do que a melhor das
>  >  > ditaduras
>  >  >  >  >  >  > The worst of democracies is still better than the 
> better of
>  >  >  >  > dictatorships
>  >  >  >  >  >  >   MSN Messenger: ezequias at hotmail.com 
> <mailto:ezequias at hotmail.com>
>  > <mailto:ezequias at hotmail.com>
>  >  > <mailto:ezequias at hotmail.com> <mailto:ezequias at hotmail.com>
>  >  >  >  > <mailto:ezequias at hotmail.com> <mailto:ezequias at hotmail.com>
>  >  >  >  >  > <mailto:ezequias at hotmail.com>
>  >  >  >  >  >  >
>  >  >  >  >  >  >
>  >  >  >  >  >  > Add FUN to your email - CLICK HERE!
>  >  >  >  >  >  > <http://www.incredimail.com/index.asp?id=54760>
>  >  >  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > Ezequias,
>  >  >  >  >  >
>  >  >  >  >  > Well, I think one cannot make more suggestions you 
> already got
>  >  >  > from the
>  >  >  >  >  > error messages!
>  >  >  >  >  >
>  >  >  >  >  > I assume your postgres is running and your connection 
> string is
>  >  >  > correct,
>  >  >  >  >  > but you should send it to the list, too.
>  >  >  >  >  >
>  >  >  >  >  > A common error is, that the postgresql-server does not accept
>  >  > tcp/ip
>  >  >  >  >  > connections. Check your postgresql.conf: "tcpip_socket = 
> true"
>  >  > must be
>  >  >  >  >  > there.
>  >  >  >  >  > Second, check your pg_hba.conf: There has to be an entry that
>  >  > allows
>  >  >  >  >  > your "mapserver-host" to connect to the server, such as
>  >  >  >  >  >
>  >  >  >  >  > for remote access of the network 192.168.100.0:
>  >  >  >  >  > host    all         all         192.168.100.0
>  > 255.255.255.0
>  >  >  >  > trust
>  >  >  >  >  >
>  >  >  >  >  > or for local access, if mapserver and pgsql are on the same
>  > host:
>  >  >  >  >  > host    all         all         127.0.0.1
>  >  >  > 255.255.255.255   trust
>  >  >  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > Hope, that helps!
>  >  >  >  >  >
>  >  >  >  >  > Ben
>  >  >  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > Add FUN to your email - CLICK HERE!
>  >  >  >  >  > <http://www.incredimail.com/index.asp?id=54760>
>  >  >  >  >
>  >  >  >  > Ezequias,
>  >  >  >  >
>  >  >  >  > As you're using postgresql 8, you must remove the tcpip_socket
>  >  >  >  > parameter, because it's a paramater used in earlier postgresql
>  >  > versions.
>  >  >  >  > Look again into your posgresql.conf. You'll need to have the
>  > following
>  >  >  >  > at the beginning of the file:
>  >  >  >  >
>  >  >  >  > listen_addresses = '*' # what IP interface(s) to listen on;
>  >  >  >  >      # defaults to localhost, '*' = any
>  >  >  >  >
>  >  >  >  > Restart pgsql.
>  >  >  >  >
>  >  >  >  > Ben
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >
>  >  >  >  > Add FUN to your email - CLICK HERE!
>  >  >  >  > <http://www.incredimail.com/index.asp?id=54760>
>  >  >  >
>  >  >  >
>  >  >  > Add FUN to your email - CLICK HERE!
>  >  >  > <http://www.incredimail.com/index.asp?id=54760>
>  >  >
>  >  >
>  >  >
>  >  > Ezequias,
>  >  >
>  >  > Please always reply to the list!
>  >  >
>  >  > Of course you receive the mails twice. One Mail goes to the list 
> and the
>  >  > other to you directly. Some list-members only reply to the list, but
>  >  > most reply to both.
>  >  >
>  >  >
>  >  >
>  >  > Another point, please do not top post!
>  >  >
>  >  >
>  >  > I'm afraid, that I have no more ideas! Your problem needs hard 
> debugging
>  >  > ;-).
>  >  >
>  >  > Install pgadmin-III and/or phppgadmin and try to connect to your
>  >  > pgsql-server from your mapserver-server, also you could try to connect
>  >  > from your remote machine from command-line with "psql -Upostgres
>  >  > -hlab1.recife -ddbpostgis".
>  >  >
>  >  >
>  >  > As your machines are on different network segments, it is quite 
> likely,
>  >  > that port 5432 is blocked by a firewall - you have to ask your IT to
>  >  > unlock this port.
>  >  >
>  >  >
>  >  >
>  >  > Ben
>  >  >
>  >  >
>  >  > Add FUN to your email - CLICK HERE!
>  >  > <http://www.incredimail.com/index.asp?id=54760>
>  >
>  > Ezequias,
>  >
>  > 1. Reply to the list, please.
>  > 2. Don't top post, please.
>  > 3. Do not change the subject line, please.
>  >
>  >
>  >
>  >
>  > You need to have two accounts, one for the system, to start the
>  > postmaster and of course on as the database super user, which we are
>  > talking about.
>  >
>  > Did you explicitely change the password for the database super user
>  > "postgres"?
>  >
>  > Ben
>  >
>  >
>  > Add FUN to your email - CLICK HERE!
>  > <http://www.incredimail.com/index.asp?id=54760>
>  
>  
>  
> Ezequias,
>  
> If you engage the help of a user list, then the conversation has to be
> _over_ _the_ _list_, so that somebody else could take advantage of this
> technical support. So please Ezequias, push the "Reply all" button and
> post _all_ your answers to list.
>  
> Second, you're adviced to continue any conversation at the _end_ of the
> mail you are replying to, so that it is much easier for others to follow
> the conversation.
>  
>  
>  
> Can you access postgres via "psql -Upostgres -ddbpostgis" if you are
> logged in as root or some other user - _not_ postgres!? If not, the
> pg_hba.conf you sent is likely not the one, your pgsql-Server is using.
>  
> If you "psql" into your database, psql "takes" the credentials with
> which you are logged into your linux shell. So, either you provide
> -U<username> to psql or you type "su - postgres", then you don't need a
> "-U".
>  
>  
> Ben
>  
>  
>  
>  
>  Ben,
>  
> I never recieve any post about the way I send my messages (at begin or 
> at end) but if you are not fine with it, I will send now at the End of 
> the e-mail.

Ezequias,

this is not my idea, there is an etiquette how to use a mailing list, 
basically applying to all user lists, e.g.:
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/etiquette.html




>  
> I just can access postgresql via postgres user (linux user):
>  
> [postgres at machine ~]$ psql -D /usr/local/pgsql/data
>  
> The connection occours with no problem.

If you cannot login in as some other user then the linux postgres to 
connect to the database, mapserver will never be able to establish a 
connection. You devinitely need to be able to do the following:

[someUser at machine ~]$ psql -Upostgres -ddbname


So, if you can't do that, it sounds to me that your pg_hba.conf your 
database server is actually using, is not the one you sent to me, 
because there is an alternative authentication method to 
password/trust/md5, which is called "ident sameuser". That means you 
_must_ be logged into a linux shell with a user which also exits in your 
database!. That is why only "su - postgres" is working.

Ben


>  
> Ezequias
> 		
> 
> Add FUN to your email - CLICK HERE! 
> <http://www.incredimail.com/index.asp?id=54760>



More information about the MapServer-users mailing list