Menu

login failed - how to config logs

Help
2007-10-24
2013-06-11
  • Nobody/Anonymous

    Hi, I can't login in phpPgAdmin. I've installed phpPgAdmin in all the RHEL and FC distros, but in RHEL3 I can't make it work properly. I can't see any information in the RHEL3 logs, I only see a 'Login failed' error in /var/log/messages which is useless. I don't know how can I config Postgre to see useful information about the login error in phpPgAdmin.

    Thanks.

     
    • J.Guillaume (ioguix) de Rorthais

      Hello,

      How did you setup your conf/config.inc.php in ppa ? what about your pg_hba.conf ? server entries in conf/config.inc.php should be setted according to your pg_hba.conf...

      Moreover, PostgreSQL should have its own log file (probably in /var/log/postgresql/ ?) instead of /var/log/messages.

      ++

       
    • Nobody/Anonymous

      I know that exists a log file in /var/log/pgsql, but it's empty, so I don't know what to do to make postgre to log in it.

      I've review config files and they're correct. But I also have a doubt. I have 2 config files <ppa>/config.inc.php y <ppa>/conf/config.inc.php, which is the one that ppa uses??

       
      • J.Guillaume (ioguix) de Rorthais

        PPA uses conf/config.inc.php.

        could you show us your pg_hba.conf and conf/config.inc.php please ?

        could you log in your db using with psql ?

         
    • Nobody/Anonymous

      ppa is in the same server that pgsql. I can log in Postgre using psql without any problems.

      pg_hba.conf:
      local   all        postgres                 md5
      local   template1  all                      md5
      local   sameuser   all                      md5
      host    sameuser   all      0.0.0.0 0.0.0.0 md5

      conf/config.inc.php:
      $conf['servers'][0]['desc'] = 'PostgreSQL';  
      $conf['servers'][0]['host'] = '';
      $conf['servers'][0]['port'] = 5432;
      $conf['servers'][0]['sslmode'] = 'allow';
      $conf['servers'][0]['defaultdb'] = 'template1';
      $conf['servers'][0]['pg_dump_path'] = '/usr/bin/pg_dump';
      $conf['servers'][0]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';
      $conf['servers'][0]['slony_support'] = false;
      $conf['servers'][0]['slony_sql'] = '/usr/share/pgsql';
      $conf['default_lang'] = 'auto';
      $conf['autocomplete'] = 'default on';
      $conf['extra_login_security'] = true;
      $conf['owned_only'] = false;
      $conf['show_comments'] = true;
      $conf['show_advanced'] = false;
      $conf['show_system'] = false;
      $conf['show_reports'] = true;
      $conf['owned_reports_only'] = false;
      $conf['min_password_length'] = 1;
      $conf['left_width'] = 200;
      $conf['theme'] = 'default';
      $conf['show_oids'] = false;
      $conf['max_rows'] = 30;
      $conf['max_chars'] = 50;
      $conf['use_xhtml'] = false;
      $conf['help_base'] = 'http://www.postgresql.org/docs/%s/interactive/';
      $conf['version'] = 17;

       
      • J.Guillaume (ioguix) de Rorthais

        So,

        According to your pg_hba.conf file, you can login to your dbms using socket with all roles but only to access the template1 database (local template1 all md5).

        Moreover, you can log as postgres using socket to access every database (local all postgres md5 ).

        BUT, in ppa conf file, you have setted $conf['extra_login_security'] = true which deny postgres, admin, root (afair) roles by security.

        I guess it could be your problem and ppa should inform you about that. Try to set this conf value to false.

         
    • Nobody/Anonymous

      I've tried to set to false the extra_login_security and it doesn't work. The problem is that I'm not trying to log in using the postgres (root, admin, ...) user. I'm trying to log in using a normal account.

       
      • Robert Treat

        Robert Treat - 2007-10-25

        you need to either get your postgresql logging working correctly by way of postgresql.conf (which i strongly recommend  regardless), or hack the line with @pg_connect in libraries/adodb/drivers/adodb-postgres64.inc.php to remove the @. In either case you should recieve a FATAL error message which should tell us much more about your problem. BTW, could you also let us know if you can login via psql and the same credentials?

         
    • Nobody/Anonymous

      I've hack the line with @pg_connect and the errors shown are these:

      Warning: pg_connect(): Unable to connect to PostgreSQL server: invalid connection option "sslmode" in /usr/share/phpPgAdmin-4.1.2/libraries/adodb/drivers/adodb-postgres64.inc.php on line 655

      Warning: Cannot modify header information - headers already sent by (output started at /usr/share/phpPgAdmin-4.1.2/libraries/adodb/drivers/adodb-postgres64.inc.php:655) in /usr/share/phpPgAdmin-4.1.2/classes/Misc.php on line 372

      Any idea??

       
    • Nobody/Anonymous

      GREAT!!! FINALLY, it works!!! The problem was sslmode option that was set to 'allow'. I have set this option to 'disable' and it have worked.

      So thanks a lot for your help, Robert and Guillaume!!!

      Now, I only have a doubt. Why does the sslmode='allow' option work correctly in RHEL4 and RHEL5, but it doesn't in RHEL3??? Can I connect PG using SSL or not??

       
      • Robert Treat

        Robert Treat - 2007-10-26

        I presume RHEL3 contains the older postgresql libraries that don't support the various host options, and your postgres support inside php is compiled to those libraries. We've seen this happen to some other folks, though haven't been able to put together a solid fix that works for everyone.

         
      • Nobody/Anonymous

        I confirm this fact! I had the same problems with my RHEL3 and the only solution is to comment the line in conf/config.php that say
        $conf['servers'][0]['sslmode'] = 'allow';
        I also want to add something that i tried executing a php file from command line:
        when trying to connect with this:
                pg_connect("port=5432 sslmode='allow' user='testpgadmin' password='asdfgh' dbname='template1'");
        it complains with this message: Unable to connect to PostgreSQL server: invalid connection option "sslmode"
        But i could connect with this:
                pg_connect("port=5432 requiressl=true user='testpgadmin' password='asdfgh' dbname='template1'");
        And also with this:
                pg_connect("port=5432 user='testpgadmin' password='asdfgh' dbname='template1'");

         
        • J.Guillaume (ioguix) de Rorthais

          Hi,

          We fixed that in the current CVS.

          Please, checkout the CVS version and report if you still have connection issues.

           

Log in to post a comment.

MongoDB Logo MongoDB