Ad Widget

Collapse

Can not login to front end

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalako
    Member
    • Apr 2006
    • 30

    #1

    Can not login to front end

    Behavior: type Admin for user, no password. Hit enter. Page refreshes. Fields now blank. Still "connected as guest".

    Development Host:
    Fedora Core 4
    Zabbix1.1beta8 (I have also tried 1.0)
    Php 4.4.2
    Apache 2.0.55, running on port 82
    Mysql 5.0.18, socket /var/lib/mysql/mysql.sock (port 3306)

    Accessing zabbix as vhost to use php4 (php5 is also installed as cgi, but I have read zabbix requires apache module).
    This pulls up the the login page:


    Net-snmp and net-snmp-devel are installed. I have mrtg running and successfully monitoring traffic on eth0.

    From /var/www/html/zabbix/include/db.inc.php
    $DB_SERVER ="localhost:/var/lib/mysql/mysql.sock";

    I have tried turning off iptables.

    Mysql user zabbix has all privileges on database zabbix. I can log into mysql db zabbix with user zabbix and socket /var/lib/mysql/mysql.sock. I have loaded schema.sql and data.sql.

    I have done
    update users set passwd=’’ where alias=’Admin’;

    I have changed Admin password to ‘admin’

    There are no errors in logs from apache, mysql, or php
  • just2blue4u
    Senior Member
    • Apr 2006
    • 347

    #2
    Hi!

    You found my thread, so i don't write all that again here...

    Have you dropped the database an installed the new dumps when installing the new Zabbix Version?

    My System (hope it helps):
    - Fedora Core 4
    - Zabbix 1.1beta8
    - php-5.0.4
    - mysql-server 4.1.11
    - httpd 2.0.54
    This works fine...
    Big ZABBIX is watching you!
    (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

    Comment

    • shalako
      Member
      • Apr 2006
      • 30

      #3
      It works! What I learned...

      I've dropped the database and reloaded it a thousand times. Actually I just did it again this morning and it finally works. Ha!

      What I learned:

      First I tried zabbix 1.0.
      schema.sql wouldn't load because of "invalid default value for userid". Had to delete "default ''" for userid in the "rights" table load in schema.sql.

      frontends/php/include/db.inc.php uses php function mysql_pconnect to create a persistant connection to the database. the first variable, server, can take this socket path or a port. I suspected this would be a problem, more on this later.

      zabbix_suckerd wouldn't start, giving error on libnetsmnp.so, even though net-snmp IS installed. read on forums that devel packet is required. but net-snmp-devel is only available as rpm and I installed net-snmp from source, so the rpm wouldn't install. had to re-install snmp from rpm.

      pulling up report1.php in browser sends this to apache error_log:
      Warning: bad syntax, perhaps a bogus '-'?
      Not sure if installing net-snmp-devel or upgrading to zabbix1.1beta8 fixed this.

      zabbix 1.1beta8 compile doesn't put binaries in the bin directory. Found them in src/zabbix_agent and src/zabbix_server.

      zabbix1.0 doesn't play nice with php5-cgi. switching to php4. more later.

      Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of eregi(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /var/www/html/zabbix/include/config.inc.php on line 879

      Get rid of this error by adding to apache
      php value allow_call_time_pass_reference 1
      (I think upgrading to zabbix1.1beta8 fixed this requirement)

      couldn't login to the front end.

      mysql> update users set passwd='' where alias='Admin';
      Found this suggestion on the forums. This screws things up. The database is initally loaded with a blank passwd but it must be encrypted because it looks like there's a password set in the field if you 'select * from users;'. I noticed that the encrypted string is the same as guest's so it must be an encrypted blank string. No need to change the database.

      Database port 3306 is hard coded for the front end. Supposedly this is now configurable, but I haven't found where and I think it is only for the server, not for the front end. I have to maintain parallel mysql servers (v3,4,5) running on different ports and sockets, with php4 as module and php5 as cgi. So this caused some pain in the ass. DB_SERVER in include/db.inc.php can be set to "<host>:<socket OR port>". Notice, socket or port, but not both.

      In my case, php4 is configured for mysql3 running on port X and socket Y, and php5-cgi is configured for mysql5 running on port 3306 and socket Z. I had to use php4 because supposedly zabbix won't run on php as cgi (couldn't find anymore info on this - please fix?). So I could define the socket in DB_SERVER but it still didn't work cause it was trying to connect on port 3306; port pointed at mysql5 and socket for mysql3. So I had to config vhost php directives for zabbix vhost to point php4 at mysql5.

      What makes me slap my forehead is that, after all the mysql/php reconfig, I still had the users.passwd field null for Admin. Reloaded the db again and now it works.

      Now to the config. Ha!

      Thanks to everyone who responded to my requests for help. Especially Elkor who gave me a good deal of time.

      Comment

      • elkor
        Senior Member
        • Jul 2005
        • 299

        #4
        no problem dude.

        for what it's worth, even if I had the database dump in front of me I wouldn't have thought of that initially either, although in retrospect it makes sense.

        good luck!

        Comment

        Working...