Ad Widget

Collapse

Permissions issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lovespider
    Member
    • Sep 2004
    • 99

    #1

    Permissions issue

    Hello,
    after installing beta 1.3.2 onto beta 1.3.1 I get:

    Warning: main(include/config.inc.php): failed to open stream: Permission denied in /var/www/zabbix/index.phpWarning: main(include/config.inc.php): failed to open stream: Permission denied in /var/www/zabbix/index.php on line 22

    Fatal error: main(): Failed opening required 'include/config.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/zabbix/index.php on line 22
    on line 22

    I checked permissions and, to be sure, chmod -R 666 * in the php directory.
    Rebooted but still got this error.

    Any idea?
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    I think this is file permission problem. Something very simple
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • Lovespider
      Member
      • Sep 2004
      • 99

      #3
      Yes it was simple, I solved.
      Now I get [ERROR: Database corrupted, missed default user 'guest']

      I renamed the old database and created a new one with fresh data. Still the same.

      Users table seems ok. Where can I check what's wrong?
      Thanks a lot!

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        data.sql hasn't been loaded or, if used for distributed monitoring, you haven't ran zabbix_server -n <nodeid> to change database data to new nodeid.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • Lovespider
          Member
          • Sep 2004
          • 99

          #5
          Hi,
          I loaded data.sql but still my "nodes" table is empty. Should it contain anything?

          Comment

          • Alexei
            Founder, CEO
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Sep 2004
            • 5654

            #6
            It should not contain anything if ZABBIX is used as standalone server.
            Alexei Vladishev
            Creator of Zabbix, Product manager
            New York | Tokyo | Riga
            My Twitter

            Comment

            • Lovespider
              Member
              • Sep 2004
              • 99

              #7
              I recreated anything from scratch.
              Imported schema.sql and data.sql and images.sql but still same error.
              Every .php file has mod 777 and owner www-data.
              It happened after I overwrited php files 1.3.1 with the 1.3.2 ones.

              EDIT:
              I found that this error is given by perm.inc.php...the query seems ok. If I try to login as Admin..I get bad username or password. Any ideas?
              Last edited by Lovespider; 04-01-2007, 10:05.

              Comment

              • kurzhaarhippie
                Junior Member
                • Dec 2006
                • 14

                #8
                Did you try to use a new directory for the php scripts without overwriting your old ones?

                Comment

                • Lovespider
                  Member
                  • Sep 2004
                  • 99

                  #9
                  I just tried, here are the news:

                  1) php 1.3.1 works great
                  2) php 1.3.2 gives the "missing 'guest'" error
                  3) the zabbix_server 1.3.2 seems to do icmpping correctly but in screens the colors for the triggers are always grey

                  I guess there must be something different but I compared perm.inc.php between version and they are the same (if I'm not wrong).

                  I wait for your comments....

                  EDIT1:
                  No, after a while the pinger stops.

                  EDIT2:
                  Solved, the pinger works continuously now.
                  Last edited by Lovespider; 05-01-2007, 09:34.

                  Comment

                  • Arthur
                    Member
                    • May 2006
                    • 31

                    #10
                    Permission error

                    Hi,
                    I have the same login error messages.
                    this time i worked on a < 4.1 mysql database and PHP 4.3.10

                    The select :
                    mysql> select (u.userid / 100000000000000), u.userid,u.alias,u.name,u.surname,u.url,u.refresh from users u where u.alias='Admin'
                    -> and u.passwd='d41d8cd98f00b204e9800998ecf8427e' and (u.userid / 100000000000000)=0
                    -> ;
                    Empty set (0.00 sec)

                    But without the and (u.userid / 100000000000000)=0
                    +------------------------------+--------+-------+--------+---------------+-----+---------+
                    | (u.userid / 100000000000000) | userid | alias | name | surname | url | refresh |
                    +------------------------------+--------+-------+--------+---------------+-----+---------+
                    | 0.00 | 1 | Admin | Zabbix | Administrator | | 30 |
                    +------------------------------+--------+-------+--------+---------------+-----+---------+
                    1 row in set (0.00 sec)

                    Now i would like to run a single server and did not do anything for the 'nodes'
                    i didn't found no instructions for this in the install manual.
                    btw: i had to change the schema.sql to use the auto_increment for the ID's
                    can you pls advice what the real ID fields are in the database ?

                    i also found the make install could not overwrite the /etc/zabbix config files
                    is this a problem going from 1.3.1 to 1.3.2 ?

                    The test on the "max execution time" still fails and had to change the code to ini_get('max_execution_time') <= 300,

                    PS: The install instructions did not advice have to cp the
                    frontends/php/* to the htdocs/zabbix dir.

                    rgds
                    /Arthur

                    Comment

                    • napel25
                      Junior Member
                      • Nov 2006
                      • 18

                      #11
                      I did have the same problem (Zabbix 1.1.4 at CentOS 4.0). After executing the next Linux command, the problem was solved.

                      setenforce Permissive

                      It seems that the php code is protected en checked. When you change anything, the permissions are revoked from the web server to use the changed php file.
                      This is probably a Linux feature and differs per distribution.
                      Setting SELinux to permissive makes SELinux logging problems. When disabled (in boot conf files) it will prob not log anything.
                      Changing this makes Zabbix a little less save of course...

                      The 'setenforce' setting lasts till next reboot. To set it permanent you need to modify /etc/grub.conf or /etc/selinux/config to disable SELinux.

                      (http://www.linuxcommand.org/man_pages/setenforce8.html)
                      Last edited by napel25; 09-01-2007, 10:25.

                      Comment

                      • darkness
                        Junior Member
                        • Jan 2007
                        • 1

                        #12
                        Got past two errors on CentOS 4

                        I've got 1.3.2 at least logging in on CentOS 4, haven't tested beyond that.

                        The web interface either gives you the option to download conf/zabbix.conf.php yourself, or to let the PHP code make it for you. To let PHP make it for you, you need to make sure your webserver can write to the conf dir (chmod 777 conf and make sure to change it back when done). For SELinux users, you probably don't need to disable SELinux (i.e., setenforce 0) just chcon -Rt httpd_sys_content_t conf. Let the web server write out the configuration file, then make it so only you and the web server can read the resulting configuration file, since it has your DB password in it.

                        Second, for the "Database corrupted, missed default user 'guest'" error, the below patch should do it. Looks to me like a developer just missed the break statements, a not uncommon error (which is to say I've done it myself).

                        Code:
                        --- include/db.inc.php.orig     2007-01-12 22:07:18.000000000 -0500
                        +++ include/db.inc.php  2007-01-12 22:09:01.000000000 -0500
                        @@ -447,8 +447,10 @@
                                        {
                                                case "MYSQL":
                                                        $odiv = 'div';
                        +                               break;
                                                default:
                                                        $odiv = '/';
                        +                               break;
                                        }
                        
                                        return '('.$id_name.' '.$odiv.' 100000000000000)';

                        Comment

                        • Alexei
                          Founder, CEO
                          Zabbix Certified Trainer
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Sep 2004
                          • 5654

                          #13
                          Thanks for the patch. Fixed.
                          Alexei Vladishev
                          Creator of Zabbix, Product manager
                          New York | Tokyo | Riga
                          My Twitter

                          Comment

                          • Lovespider
                            Member
                            • Sep 2004
                            • 99

                            #14
                            I can confirm now it works.
                            Thanks darkness...

                            Comment

                            • peacestgt
                              Junior Member
                              • Jan 2007
                              • 17

                              #15
                              if i add the break in the file i get this error at the loginpage:

                              * Error in query [select u.* from users u where u.alias='guest' and (u.userid div 100000000000000)=0] [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'div 100000000000000)=0' at line 1]
                              * mysql_fetch_array(): supplied argument is not a valid MySQL result resource[/var/www/zabbix/include/db.inc.php:391]

                              Comment

                              Working...