配置哪些Postgres版本+群集PHP应该连接到(安装了2个版本)

I went through multiple posts here and elsewhere, couldn't find answer that applies to my situation.

I have one Ubuntu installation of Postgres 9.5 (not configured, dormant) and one of Postgres 9.1 (configured with users and databases). The 9.1 had to be manually re-installed after I upgraded to LTS 14.04 but my PHP applications lost their connection to the 9.1 clusters. 9.1 still runs on the default port (I manually stop the 9.5 instance on 5433):

9.1/main (port 5432): online

I can log in via psql and see all my databases in the 9.1 cluster, but I can't log in via phpPgAdmin (on port 5432), I see lots of pg_connect() warnings/errors, none of my PHP applications work (like ownCloud etc.) and they all stopped working after 9.1 was re-installed.

For various reasons, I'd like to keep working with 9.1 until I'm ready to upgrade to 9.5.

How can I get my connections back in my Apache/PHP? I know it's probably a simple thing, I just can't find which configuration option is responsible for that. Can you help?

[EDIT]: After further reading, my first guess is that it's pg_hba.conf related. I'll take a look what my values should be, I suspect it was reset to default on re-install, and now local TCP clients can't connect, only SSH seems to work.

After Ubuntu upgrade and Postgres 9.1 re-install, the 9.1/main/pg_hba.conf ONLY contained this line, narrowing access to postgres user over SSH:

local all postgres ident

whereas the default configuration on my 9.5 cluster was like this:

local   all             all                                     peer
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

The first set of parameters is not really secure, but fine in my testing environment - I'd definitely harden it on a production server. Adding localhost configuration lines above and restarting the service fixed everything.