Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D00541337B6E for ; Thu, 31 Mar 2011 17:58:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 58230-10 for ; Thu, 31 Mar 2011 20:57:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from polaris.pinpointresearch.com (cerberus.pinpointresearch.com [66.7.238.130]) by mail.postgresql.org (Postfix) with ESMTP id AF87F1337B47 for ; Thu, 31 Mar 2011 17:57:57 -0300 (ADT) Received: from betelgeuse.pinpointresearch.com (betelgeuse.pinpointresearch.com [192.168.1.179]) by polaris.pinpointresearch.com (Postfix) with ESMTP id D0D9EE00EC84; Thu, 31 Mar 2011 13:57:56 -0700 (PDT) Message-ID: <4D94EAD4.5050302@pinpointresearch.com> Date: Thu, 31 Mar 2011 13:57:56 -0700 From: Steve Crawford User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: babak badaei CC: "pgsql-admin@postgresql.org" Subject: Re: Freebsd/Postgres/Apache+PHP References: <996772.55686.qm@web111305.mail.gq1.yahoo.com> In-Reply-To: <996772.55686.qm@web111305.mail.gq1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/298 X-Sequence-Number: 37170 On 03/31/2011 12:18 PM, babak badaei wrote: > Hello Postgres Community, > > Thank you guys very much for PostgreSQL. To me, its the best database management system under the sun. I am setting up a new jail configuration on FreeBSD with sockets and everything enabled. I can ping localhost fine. The problem is that when I load a script that connects to the database, Postgres says Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "x.x.x.x" (my actual web IP). I have done the following on the host machine: > I'd like Apache/PHP to just connect to Postgres localhost, not via the jail's IP--thus, no change to pg_hba.conf is needed. > > If you guys have any suggestions it would be very much appreciated! > I have no experience actually using a modern FreeBSD jail, but I do have some questions? 1. Are PHP and PostgreSQL running in different jails? 2. What are the addresses PostgreSQL is set to listen on? 3. What PHP statement are you using to establish the connection? 4. If PHP and PostgreSQL are on different jails, 1. Be sure you are connecting with localhost, not local unix domain sockets (it appears you are based on the error message). 2. Is PHP running on a different jail than PHP? If my reading is correct, a FreeBSD jail is basically a virtual host and has its own IP addresses and I doubt that the loopback localnet is shared among those hosts. 3. What is the IP address of the server and of the client and what PHP connection statement are you using? Cheers, Steve