Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16518

Latest data page is broken on centos-7 under nginx

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • 4.4 (plan)
    • 4.4.0alpha1
    • Frontend (F), Packages (C)
    • None
    • Sprint 56 (Sep 2019), Sprint 55 (Aug 2019)
    • 1

      The problem occurs on centos-7 when using nginx.
      When navigating to "Latest data" page the user gets logged out.

       

      How to reproduce:

      Install zabbix frontend on centos-7 with nginx.

      rpm -Uvh http://repo.zabbix.com/zabbix/4.3/rhel/7/x86_64/zabbix-release-4.3-1.el7.noarch.rpm
      yum install zabbix-web-mysql zabbix-nginx-conf

      Uncomment timezone setting in /etc/php-fpm.d/zabbix.conf file.

      [zabbix]
      user = apache
      group = apache
      
      listen = /run/php-fpm/zabbix.sock
      listen.owner = nginx
      listen.allowed_clients = 127.0.0.1
      
      pm = dynamic
      pm.max_children = 50
      pm.start_servers = 5
      pm.min_spare_servers = 5
      pm.max_spare_servers = 35
      
      php_value[session.save_handler] = files
      php_value[session.save_path] = /var/lib/php/session
      
      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[max_input_vars] = 10000
      ; php_value[date.timezone] = Europe/Riga

      Edit "listen" and/or "server_name" directives in /etc/nginx/conf.d/zabbix.conf file.

      server {
          # listen 80;
          # server_name example.com;
      
          root /usr/share/zabbix;
      
           index index.php;
      ...

      Start nginx and php-fpm

      systemctl start php-fpm nginx

      Disable firewall and selinux

      systemctl stop firewalld
      setenforce 0

      In the frontend got through the setup page.
      Navigate to "Monitoring" > "Latest data" page.
      You should immediately be logged out.

      Presumably this is due to the old php version used in centos-7

      PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
      Copyright (c) 1997-2013 The PHP Group
      Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
      

      Would be nice for the frontend guys to take a look at this.

       

      Here are example config files for nginx and php-fpm if you don't want to use packages.
      zabbix-php-fpm.conf

      zabbix-nginx.conf

      Put these into /etc/php-fpm.d/ and /etc/nginx/conf.d/ directories and edit as needed.

        1. LatestData_LoggedOut.png
          43 kB
          Jurijs Klopovskis
        2. zabbix-nginx.conf
          2 kB
          Jurijs Klopovskis
        3. zabbix-php-fpm.conf
          0.6 kB
          Jurijs Klopovskis

            basilgon Vasily Goncharenko (Inactive)
            yurii Jurijs Klopovskis
            Team D
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: