Ad Widget

Collapse

Centos 7.3.1611 + Zabbix 3.07-1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joma
    Junior Member
    • Nov 2015
    • 3

    #1

    Centos 7.3.1611 + Zabbix 3.07-1

    Hi,

    I can't run the Zabbix frontend (and configure Zabbix), because apache always gives a php error when try to open maintenance.inc.php:

    PHP Fatal error: require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' ...

    I have SElinux disabled, and I have tried to change maintenance.inc.php permissions and owner without success.

    The zabbix is installed from repository.

    My apache zabbix.conf is:


    Alias /zabbix /usr/share/zabbix

    <Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Require all granted

    <IfModule mod_php5.c>
    php_value max_execution_time 300
    php_value memory_limit 128M
    php_value post_max_size 16M
    php_value upload_max_filesize 2M
    php_value max_input_time 300
    php_value always_populate_raw_post_data -1
    php_value date.timezone Europe/Lisbon
    </IfModule>
    </Directory>

    <Directory "/usr/share/zabbix/conf">
    Require all denied
    </Directory>

    <Directory "/usr/share/zabbix/app">
    Require all denied
    </Directory>

    <Directory "/usr/share/zabbix/include">
    Require all denied
    </Directory>

    <Directory "/usr/share/zabbix/local">
    Require all denied
    </Directory>


    Any help please?

    Thanks in advance.

    Jorge Mota
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Please do not skip the error message to the end.
    Also run the getenforce command and check that SELinux is Disabled.

    Comment

    • joma
      Junior Member
      • Nov 2015
      • 3

      #3
      Thank you

      httpd error log message:

      [Sun Feb 26 17:21:09.576458 2017] [:error] [pid 24792] [client 10.0.1.4:64820] PHP Warning: require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Permission denied in /usr/share/zabbix/include/classes/core/ZBase.php on line 292
      [Sun Feb 26 17:21:09.576496 2017] [:error] [pid 24792] [client 10.0.1.4:64820] PHP Fatal error: require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/zabbix/include/classes/core/ZBase.php on line 292

      getenforce output: Disabled

      Thanks in Advance.

      Comment

      • joma
        Junior Member
        • Nov 2015
        • 3

        #4
        Solved.

        Wrong permissions set by rpm instalation.
        The folder "/etc/zabbix/web" and the file "/etc/zabbix/web/maintenance.inc.php" must have o+x permission to work.
        After instalation others only have permission to read.

        Thanks.

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          o+x permission is unnecessary for file "/etc/zabbix/web/maintenance.inc.php".
          Read permission is required.

          For directory "/etc/zabbix/web", the default permissions are as follows.

          Code:
          drwxr-x--- 2 apache apache 54 12月 16 14:52 /etc/zabbix/web/
          There is no problem if it is started with the default apache user using CentOS 7 standard httpd package.
          If you change the default httpd setting and use it, you need to change the permission according to that environment.

          Comment

          • Ace Cooper
            Junior Member
            • Jul 2017
            • 2

            #6
            Correct permissions

            In layman's terms I would suggest one of two solutions:

            1) either add the user of your Zabbix web-interface to the group "apache" to allow him access to /etc/zabbix/web/maintenance.inc.php:
            Code:
            usermod -a -G apache YOUR_ZABBIX_WEB_USER
            2) or change permissions of the /etc/zabbix/web/ folder from 750 to 755 (but you will have to repeat it again after each Zabbix update, so 1st method is preferable):
            Code:
            chmod 755 /etc/zabbix/web/
            Last edited by Ace Cooper; 07-08-2017, 18:04. Reason: added title

            Comment

            Working...