I'm trying to access a postgresql database via the graphical frontends pgAccess and phpPgAdmin, running under FC6 (completely up-to-date via yum). The access control file, pg_hba.conf, contains
# TYPE DATABASE USER CIDR-ADDRESS METHOD local all all md5 host all all 127.0.0.1/32 md5 host all all ::1/128 md5 host all all 192.168.0.3 255.255.255.255 md5
and I've edited /etc/init.d/postgresql to launch the postmaster with the -i option to allow remote connections.
With pgAccess, I am unable to open the database using the host localhost (couldn't open socket: host is unreachable), but using the ip (192.168.0.3) works fine; at least after adding the final line shown in my pg_hba.conf above.
With phpPgAdmin, when I enter http://localhost/phpPgAdmin in the browser, I'm delivered to phpPgAdmin login page, but cannot login/open the database (error message: login failed). However, when I enter http://192.168.0.3/phpPgAdmin in the browser (the line that works for pgAcess), I can't even get to the login screen message: (error message: Forbidden: You don't have permission to access /phpPgAdmin on this server).
I have read through the docs and online forums, and experimented with various settings in pg_hba.conf, config.inc.php, php.ini, /etc/init.d/postgresql, postgresql.conf, etc., as described in various posts, but I'm stumped. I haven't seen this exact behavior described before and was hoping it might enable on of you to tell me what I'm missing or where I might look next.
Thanks for your help.
Daniel ___________________________ "Truth is our most valuable commodity--let us economize." -- Mark Twain
On Thu, 2007-02-01 at 20:04 -0800, parishd wrote:
I'm trying to access a postgresql database via the graphical frontends pgAccess and phpPgAdmin, running under FC6 (completely up-to-date via yum). The access control file, pg_hba.conf, contains
# TYPE DATABASE USER CIDR-ADDRESS METHOD local all all md5 host all all 127.0.0.1/32 md5 host all all ::1/128 md5 host all all 192.168.0.3 255.255.255.255 md5
and I've edited /etc/init.d/postgresql to launch the postmaster with the -i option to allow remote connections.
With pgAccess, I am unable to open the database using the host localhost (couldn't open socket: host is unreachable), but using the ip (192.168.0.3) works fine; at least after adding the final line shown in my pg_hba.conf above.
With phpPgAdmin, when I enter http://localhost/phpPgAdmin in the browser, I'm delivered to phpPgAdmin login page, but cannot login/open the database (error message: login failed). However, when I enter http://192.168.0.3/phpPgAdmin in the browser (the line that works for pgAcess), I can't even get to the login screen message: (error message: Forbidden: You don't have permission to access /phpPgAdmin on this server).
I have read through the docs and online forums, and experimented with various settings in pg_hba.conf, config.inc.php, php.ini, /etc/init.d/postgresql, postgresql.conf, etc., as described in various posts, but I'm stumped. I haven't seen this exact behavior described before and was hoping it might enable on of you to tell me what I'm missing or where I might look next.
Thanks for your help.
---- I don't know anything about pgAccess - I've never used it.
I do occasionally use phppgadmin.
I would venture to guess that you are running into SELinux issues...is it on? If so, try turning it off to get it out of the way, work all your connection issues through and then turn it back on so you can create the rules/policies necessary to allow it to work.
Craig
On 2/2/07, Craig White craig@tobyhouse.com wrote:
I would venture to guess that you are running into SELinux issues...
Dang, normally the first thing I check, but didn't this time and guess what? Thanks for the nudge Craig! It's strange that I was getting no errors about it in /var/log/messages _until_ I disabled selinux; now I'm getting a denied message although it's not being enforced.
Still have the strangeness of being able to access the dbs via pgAccess with the ip address but not localhost, and via phpPgAdmin via localhost but not the ip, but at least I'm in.
Thanks again.
Daniel
On 2/2/07, parishd parishd@gmail.com wrote:
On 2/2/07, Craig White craig@tobyhouse.com wrote:
I would venture to guess that you are running into SELinux issues...
Dang, normally the first thing I check, but didn't this time and guess what? Thanks for the nudge Craig! It's strange that I was getting no errors about it in /var/log/messages _until_ I disabled selinux; now I'm getting a denied message although it's not being enforced.
Still have the strangeness of being able to access the dbs via pgAccess with the ip address but not localhost, and via phpPgAdmin via localhost but not the ip, but at least I'm in.
Thanks again.
Daniel
Neglected to mention that the access to the db via phpPgAdmin was solved by checking the "Allow HTTPD scripts and modules to network connect to databases" in the SELinux tab of system-config-securitylevel under Modify SELinux Policy/HTTPD Service.
Daniel
On Fri, 2007-02-02 at 11:46 -0800, parishd wrote:
On 2/2/07, parishd parishd@gmail.com wrote:
On 2/2/07, Craig White craig@tobyhouse.com wrote:
I would venture to guess that you are running into SELinux issues...
Dang, normally the first thing I check, but didn't this time and guess what? Thanks for the nudge Craig! It's strange that I was getting no errors about it in /var/log/messages _until_ I disabled selinux; now I'm getting a denied message although it's not being enforced.
Still have the strangeness of being able to access the dbs via pgAccess with the ip address but not localhost, and via phpPgAdmin via localhost but not the ip, but at least I'm in.
Thanks again.
Daniel
Neglected to mention that the access to the db via phpPgAdmin was solved by checking the "Allow HTTPD scripts and modules to network connect to databases" in the SELinux tab of system-config-securitylevel under Modify SELinux Policy/HTTPD Service.
---- I was gonna get around to that once you confirmed that it was SELinux that was blocking your efforts.
The other issue is very possibly the md5 access for the 'postgres' user which is probably blocked from executing the binary since a connection attempt using md5 would require the 'user postgres' to execute the binary.
Craig