Ad Widget

Collapse

Cannot open Zabbix UI when using apache web server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • delmicpatel
    Junior Member
    • May 2023
    • 3

    #1

    Cannot open Zabbix UI when using apache web server

    I try to open the Zabbix UI on Firefox (Ubuntu 20.04) with the URL: http://localhost/zabbix/, and get the following raw message instead of the UI. The
    Server=127.0.0.1
    is the localhost assigned in the zabbix_agentd.conf file.

    Code:
    [T_ZBX_STR, O_NO, null, null, 'isset({enter}) && {enter} != "'.ZBX_GUEST_USER.'"', _('Username')], 'password' => [T_ZBX_STR, O_OPT, P_NO_TRIM, null, 'isset({enter}) && {enter} != "'.ZBX_GUEST_USER.'"'], 'sessionid' => [T_ZBX_STR, O_OPT, null, null, null], 'reconnect' => [T_ZBX_INT, O_OPT, P_SYS, null, null], 'enter' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'autologin' => [T_ZBX_INT, O_OPT, null, null, null], 'request' => [T_ZBX_STR, O_OPT, null, null, null], 'form' => [T_ZBX_STR, O_OPT, null, null, null] ]; check_fields($fields); if (hasRequest('reconnect') && CWebUser::isLoggedIn()) { if (CAuthenticationHelper::get(CAuthenticationHelper::SAML_AUTH_ENABLED) == ZBX_AUTH_SAML_ENABLED && CAuthenticationHelper::get(CAuthenticationHelper::SAML_SLO_URL) !== '' && CSessionHelper::has('saml_data')) { redirect('index_sso.php?slo'); } CWebUser::logout(); redirect('index.php'); } $autologin = hasRequest('enter') ? getRequest('autologin', 0) : getRequest('autologin', 1); $request = getRequest('request', ''); if ($request !== '' && !CHtmlUrlValidator::validateSameSite($request)) { $request = ''; } if (!hasRequest('form') && CAuthenticationHelper::get(CAuthenticationHelper::HTTP_AUTH_ENABLED) == ZBX_AUTH_HTTP_ENABLED && CAuthenticationHelper::get(CAuthenticationHelper::HTTP_LOGIN_FORM) == ZBX_AUTH_FORM_HTTP && !hasRequest('enter')) { redirect('index_http.php'); } // login via form if (hasRequest('enter') && CWebUser::login(getRequest('name', ZBX_GUEST_USER), getRequest('password', ''))) { CSessionHelper::set('sessionid', CWebUser::$data['sessionid']); if (CWebUser::$data['autologin'] != $autologin) { API::User()->update([ 'userid' => CWebUser::$data['userid'], 'autologin' => $autologin ]); } $redirect = array_filter([CWebUser::isGuest() ? '' : $request, CWebUser::$data['url'], CMenuHelper::getFirstUrl()]); redirect(reset($redirect)); } if (CWebUser::isLoggedIn() && !CWebUser::isGuest()) { redirect(CWebUser::$data['url'] ? : CMenuHelper::getFirstUrl()); } $messages = get_and_clear_messages(); echo (new CView('general.login', [ 'http_login_url' => (CAuthenticationHelper::get(CAuthenticationHelper::HTTP_AUTH_ENABLED) == ZBX_AUTH_HTTP_ENABLED) ? (new CUrl('index_http.php'))->setArgument('request', getRequest('request')) : '', 'saml_login_url' => (CAuthenticationHelper::get(CAuthenticationHelper::SAML_AUTH_ENABLED) == ZBX_AUTH_SAML_ENABLED) ? (new CUrl('index_sso.php'))->setArgument('request', getRequest('request')) : '', 'guest_login_url' => CWebUser::isGuestAllowed() ? (new CUrl())->setArgument('enter', ZBX_GUEST_USER) : '', 'autologin' => $autologin == 1, 'error' => (hasRequest('enter') && $messages) ? array_pop($messages) : null ]))->getOutput(); session_write_close();
    Please find zabbix and apache2 log contents:
    • /var/log/zabbix/zabbix_agentd.log
    12671:20230523:160909.906 Starting Zabbix Agent [odemis host]. Zabbix 6.0.17 (revision c81d82859a8).
    12671:20230523:160909.906 **** Enabled features ****
    12671:20230523:160909.906 IPv6 support: YES
    12671:20230523:160909.906 TLS support: YES
    12671:20230523:160909.906 **************************
    12671:20230523:160909.906 using configuration file: /etc/zabbix/zabbix_agentd.conf
    12671:20230523:160909.914 agent #0 started [main process]
    12676:20230523:160909.916 agent #4 started[listener #3]
    12675:20230523:160909.917 agent #3 started[listener #2]
    12674:20230523:160909.917 agent Forum started[listener #1]
    12677:20230523:160909.918 agent #5 started [active checks #1]
    12677:20230523:160909.920 Unable to connect to [127.0.0.1]:10051 [TCP successful, cannot establish TLS to [[127.0.0.1]:10051]: SSL_connect() set result code to SSL_ERROR_SSL: file ../ssl/record/rec_layer_s3.c line 1543: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure: SSL alert number 40: TLS read fatal alert "handshake failure"]
    12677:20230523:160909.920 Active check configuration update started to fail
    12673:20230523:160909.922 agent Home started [collector]
    • /var/log/zabbix/zabbix_server.log
    itable signature algorithm: TLS write fatal alert "handshake failure"
    12836:20230523:161022.872 cannot find requested PSK identity "ZBX-PSK-02"
    12836:20230523:161022.872 failed to accept an incoming connection: from 127.0.0.1: TLS handshake set result code to 1: file ../ssl/t1_lib.c line 2750: error:14201076:SSL routines:tls_choose_sigalg:no suitable signature algorithm: TLS write fatal alert "handshake failure"
    12836:20230523:161023.873 cannot find requested PSK identity "ZBX-PSK-02"
    12836:20230523:161023.874 failed to accept an incoming connection: from 127.0.0.1: TLS handshake set result code to 1: file ../ssl/t1_lib.c line 2750: error:14201076:SSL routines:tls_choose_sigalg:no suitable signature algorithm: TLS write fatal alert "handshake failure"
    • /var/log/apache2/error.log
    [Tue May 23 15:12:19.799206 2023] [mpm_event:notice] [pid 1189:tid 140327191710784] AH00489: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
    [Tue May 23 15:12:19.801175 2023] [core:notice] [pid 1189:tid 140327191710784] AH00094: Command line: '/usr/sbin/apache2'
    [Tue May 23 16:09:09.919531 2023] [mpm_event:notice] [pid 1189:tid 140327191710784] AH00491: caught SIGTERM, shutting down
    [Tue May 23 16:09:09.953855 2023] [mpm_event:notice] [pid 12693:tid 139679550753856] AH00489: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
    [Tue May 23 16:09:09.953908 2023] [core:notice] [pid 12693:tid 139679550753856] AH00094: Command line: '/usr/sbin/apache2'​
    • /var/log/apache2/access.log

    127.0.0.1 - - [23/May/2023:15:55:45 +0200] "GET /zabbix/ HTTP/1.1" 304 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
    127.0.0.1 - - [23/May/2023:15:57:43 +0200] "GET /zabbix/ HTTP/1.1" 304 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
    127.0.0.1 - - [23/May/2023:15:57:44 +0200] "GET /zabbix/ HTTP/1.1" 304 180 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
    127.0.0.1 - - [23/May/2023:15:57:45 +0200] "GET /zabbix/ HTTP/1.1" 304 180 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
    127.0.0.1 - - [23/May/2023:15:57:46 +0200] "GET /zabbix/ HTTP/1.1" 304 180 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
    127.0.0.1 - - [23/May/2023:16:09:18 +0200] "GET /zabbix/ HTTP/1.1" 200 4135 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"​
    Does anybody have a suggestion on what I should try to make it work?

    Thank you in advance!​
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    Is this a new install? Did you ever get the frontend setup.php screens? Check that php-fpm is running. Look for php errors in /var/log/php-fpm (May be different on your distro, I use Rocky.

    The agentd appears to be trying to encrypt traffic to the server, that and the server log show that is failing, but that should not be related to the frontend problem.

    Comment

    • delmicpatel
      Junior Member
      • May 2023
      • 3

      #3
      Thanks for your reply!

      Is this a new install?
      No, its not a clean install. The issue was apache2 processes/child processes were consuming 100% CPU all core. I was trying to find the root cause for it.

      My platform:
      • Zabbix version: 6.0 LTS
      • OS: Ubuntu 20.04
      • Zabbix component: Server, Frontend, Agent
      • Database: MySQL
      • Web Server: Apache

      To find the root cause I switched from apache web server to nginx. Still it didn't make any difference. Later I found that removing the recently created Dashboard from my custom Configuration -> Templates solved the problem. Then I reverted back to using apache as my web server and here is when the frontend broke (I guess some unnecessary apt remove --purge command).

      Did you ever get the frontend setup.php screens?
      No

      Check that php-fpm is running.
      It was not running.

      ● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
      Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; disabled; vendor p>
      Active: inactive (dead)
      Docs: manhp-fpm7.4(8)


      Look for php errors in /var/log/php-fpm
      [23-May-2023 10:45:14] NOTICE: fpm is running, pid 427835
      [23-May-2023 10:45:14] NOTICE: ready to handle connections
      [23-May-2023 10:45:14] NOTICE: systemd monitor interval set to 10000ms
      [23-May-2023 10:45:19] NOTICE: Terminating ...
      [23-May-2023 10:45:19] NOTICE: exiting, bye-bye!


      I restarted the php7.4-fpm service
      Code:
      sudo systemctl restart php7.4-fpm.service
      ● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
      Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; disabled; vendor p>
      Active: active (running) since Wed 2023-05-24 08:35:16 CEST; 1s ago
      Docs: manhp-fpm7.4(8)
      Process: 26223 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /ru>
      Main PID: 26207 (php-fpm7.4)
      Status: "Ready to handle connections"
      Tasks: 3 (limit: 38230)
      Memory: 13.7
      CGroup: /system.slice/php7.4-fpm.service
      ├─26207 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
      ├─26221 php-fpm: pool www
      └─26222 php-fpm: pool www
      [24-May-2023 08:35:16] NOTICE: fpm is running, pid 26207
      [24-May-2023 08:35:16] NOTICE: ready to handle connections
      [24-May-2023 08:35:16] NOTICE: systemd monitor interval set to 10000ms

      Comment

      • delmicpatel
        Junior Member
        • May 2023
        • 3

        #4
        I resolved the problem by following the below steps:

        Code:
        sudo apt install php-fpm
        sudo a2enmod proxy_fcgi setenvif
        sudo a2enconf php7.4-fpm
        sudo systemctl restart apache2.service
        Thanks for your support!

        Comment

        Working...