# Jails/localhost/postgresql



## badaei (Mar 31, 2011)

Hello BSD community,

First off, thank you very much for everything. I am running the new FreeBSD 8.2 OS and really like it. It keeps getting better everyday. However, with the improvements I am sometimes lost in how things have changed.

Right now I am attempting to implement a simple Apache/PHP/Postgres setup running inside of a jail. It is pretty much the exact same setup as before. 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:

`sysctl security.jail.allow_raw_sockets=1`
`sysctl security.jail.sysvipc_allowed=1`

*ping* works within the jail.

I'd like Apache/PHP to just connect to Postgres localhost, not via the jail's IP. What could I be doing wrong? Your guidance is much appreciated. 

Thank you.


----------



## Alt (Mar 31, 2011)

In jails 'localhost' belongs to host system, so you should setup access to jail ip, too


----------



## zennybsd (Mar 31, 2011)

Maybe, you have to specify the specific IP address of the postgresql jail instead of localhost. 

If you are not using something like VIMAGE+epair or VPS for FreeBSD, localhost hostname is reserved for the host node, I guess.


----------



## DutchDaemon (Mar 31, 2011)

badaei, do not post the same topic in multiple forums.


----------

