Ad Widget

Collapse

Frontend error 404

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Xyue
    Member
    • Jan 2016
    • 93

    #1

    Frontend error 404

    Hi guys,

    I tried to install Zabbix in 2 VM. VM A for webserver and VM B for database.

    In VM B, I have installed Mysql database and has import create.sql.


    In VM A, I followed below links and documentation in the zabbix.

    Below is the database configuration in zabbix_server.conf that i set:
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=abc123
    DBPort=3306

    I was unable to find Apache configuration file for Zabbix frontend at /etc/httpd/conf.d/zabbix.conf.

    When i browse to http://ip/zabbix, i got below error mention url not found
    Not Found
    The requested URL /zabbix was not found on this server.
    Apache/2.2.15 (CentOS) Server at 10.4.2.238 Port 80

    I checked iptables and port 80 is allowed.

    I have checked also the http error log as shown below:
    [error] [client x.x.x.x] Directory index forbidden by Options directive: /var/www/html/
    [error] [client x.x.x.x] File does not exist: /var/www/html/zabbix
    [error] [client x.x.x.x] Directory index forbidden by Options directive: /var/www/html/
    [error] [client x.x.x.x] File does not exist: /var/www/html/zabbix
    [error] [client x.x.x.x] File does not exist: /var/www/html/zabbix
    [error] [client x.x.x.x] File does not exist: /var/www/html/zabbix
    [root@localhost httpd]#

    Can anyone advise me which steps i have wrong doing ?

    Thank you very much in advance.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Are you installed packages for Web frontend?
    ex. zabbix-web-mysql

    Comment

    • Xyue
      Member
      • Jan 2016
      • 93

      #3
      Hi Atsushi,

      Yes, zabbix-web-mysql has been installed.

      [root@localhost ~]# yum install zabbix-web-mysql
      Loaded plugins: fastestmirror, refresh-packagekit, security
      Setting up Install Process
      Loading mirror speeds from cached hostfile
      * base: centos.usonyx.net
      * epel: mirror.wanxp.id
      * extras: centos.usonyx.net
      * updates: centos.usonyx.net
      * webtatic: sp.repo.webtatic.com
      Package zabbix-web-mysql-3.0.3-1.el6.noarch already installed and latest version
      Nothing to do
      [root@localhost ~]# cd /var/www/html
      [root@localhost html]# ls
      [root@localhost html]#

      Apologies for the late reply and thank you very much in advance.
      Last edited by Xyue; 25-05-2016, 03:22.

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        After installing the zabbix-web package, are you restart the httpd?
        And, Please also performs setting of the timezone in /etc/httpd/conf.d/zabbix.conf.

        PHP of Zabbix frontend will be installed in the /usr/share/zabbix.

        Comment

        • Xyue
          Member
          • Jan 2016
          • 93

          #5
          Hi Atsushi,

          Yes. I have restart the httpd after install zabbix-web-package.

          I was not able to find zabbix.conf at /etc/httpd/conf.d. However, I found the zabbix php files in the /usr/share/zabbix/conf as you mention

          [root@localhost conf]# pwd
          /usr/share/zabbix/conf
          [root@localhost conf]# ls
          zabbix.conf.php.example
          [root@localhost conf]# vi zabbix.conf.php.example

          <?php
          // Zabbix GUI configuration file.
          global $DB;

          $DB['TYPE'] = 'MYSQL';
          $DB['SERVER'] = 'localhost';
          $DB['PORT'] = '0';
          $DB['DATABASE'] = 'zabbix';
          $DB['USER'] = 'zabbix';
          $DB['PASSWORD'] = '';
          // Schema name. Used for IBM DB2 and PostgreSQL.
          $DB['SCHEMA'] = '';

          $ZBX_SERVER = 'localhost';
          $ZBX_SERVER_PORT = '10051';
          $ZBX_SERVER_NAME = '';

          $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #6
            It is CentOS 6 is you're using?
            RHEL/CentOS 6 it will not work if you have only the standard package.

            Are you installed PHP 5.4?
            And you must install php with extensions (gd, bcmath, mbstring, xml and ldap).

            After you install the PHP 5.4, please copy the file to match the version of httpd to use.

            ex. httpd 2.2
            Code:
            # cp /usr/share/doc/zabbix-web-3.0.3/httpd22-example.conf /etc/httpd/conf.d/zabbix.conf
            ex. httpd 2.4
            Code:
            # cp /usr/share/doc/zabbix-web-3.0.3/httpd24-example.conf /etc/httpd/conf.d/zabbix.conf

            Comment

            • Xyue
              Member
              • Jan 2016
              • 93

              #7
              Hi Atsushi,

              Yes, currently using CentOS 6.7 and install via standard package.

              I have already installed php 5.4

              [root@localhost conf.d]# php -v
              PHP 5.4.45 (cli) (built: Apr 27 2016 10:36:34)
              Copyright (c) 1997-2014 The PHP Group
              Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
              [root@localhost conf.d]#

              The php extension you mention has already installed. I have also copy the file and modified the php_value date.timezone to Asia/Singapore.

              However, result still the same.

              Comment

              • Atsushi
                Senior Member
                • Aug 2013
                • 2028

                #8
                Are you restarted httpd?
                Do you have httpd of PHP settings are finished?

                ex. LoadModule, AddHandler, AddType and DirectoryIndex
                Last edited by Atsushi; 24-05-2016, 06:51.

                Comment

                • Xyue
                  Member
                  • Jan 2016
                  • 93

                  #9
                  Hi Atsushi,

                  Yes, I have everything installed and restart but still don't understand why it is not loading.

                  Anyway, i am redoing everything. Will post the result here in a short while in case it is still not loading.

                  Comment

                  • Atsushi
                    Senior Member
                    • Aug 2013
                    • 2028

                    #10
                    The following procedure is a way to use the PHP 5.4 of SCL.

                    Code:
                    # yum install httpd
                    # yum install centos-release-SCL
                    # yum install php54-php php54-php-bcmath php54-php-gd php54-php-ldap php54-php-mbstring php54-php-xml
                    # yum install php54-php-mysqlnd
                    # yum install http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
                    # yum install zabbix-agent zabbix-server-mysql zabbix-web-mysql
                    # cp /usr/share/doc/zabbix-web-3.0.3/httpd22-example.conf /etc/httpd/conf.d/zabbix.conf
                    # yum install mysql-server
                    # service mysqld start
                    # mysql -uroot
                    mysql> create database zabbix character set utf8 collate utf8_bin;
                    mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password' ;
                    mysql> exit
                    # zcat /usr/share/doc/zabbix-server-mysql-3.0.3/create.sql.gz | mysql -uroot zabbix
                    
                    # vi /etc/zabbix/zabbix_server.conf
                    # vi /etc/httpd/conf.d/zabbix.conf
                    
                    # service zabbix-agent start
                    # service zabbix-server start
                    # service httpd start

                    Comment

                    • Xyue
                      Member
                      • Jan 2016
                      • 93

                      #11
                      Hi Atsushi,

                      I have follow the same steps and now it works. Although i don't know what i have change but it works now.

                      What i have do is

                      install httpd
                      install php5.4
                      install mysql
                      install zabbix
                      copy http 2.2 example conf to /etc/httpd/conf.d/zabbix.conf
                      restart the httpd

                      All the steps was same but now it works fine.

                      Now I'm trying to connect it to the remote database server. Do you have any advice that i have to notice about ?

                      So far I have open port 3306 for input and output traffic on database server but still unable to connect to the mysql database.

                      If you know what to do on the database server, please advise me.

                      Thank you very much for you help. Really appreciate

                      Comment

                      • Xyue
                        Member
                        • Jan 2016
                        • 93

                        #12
                        Hi Atsushi,

                        I manage to connect to the remote database but the server is not running.

                        I checked the zabbix-server.log and found error as below.

                        27806:20160524:164707.995 Starting Zabbix Server. Zabbix 3.0.3 (revision 60173).
                        27806:20160524:164707.995 ****** Enabled features ******
                        27806:20160524:164707.995 SNMP monitoring: YES
                        27806:20160524:164707.995 IPMI monitoring: YES
                        27806:20160524:164707.996 Web monitoring: YES
                        27806:20160524:164707.996 VMware monitoring: YES
                        27806:20160524:164707.996 SMTP authentication: NO
                        27806:20160524:164707.996 Jabber notifications: YES
                        27806:20160524:164707.996 Ez Texting notifications: YES
                        27806:20160524:164707.996 ODBC: YES
                        27806:20160524:164707.996 SSH2 support: YES
                        27806:20160524:164707.996 IPv6 support: YES
                        27806:20160524:164707.996 TLS support: YES
                        27806:20160524:164707.996 ******************************
                        27806:20160524:164707.996 using configuration file: /etc/zabbix/zabbix_server.conf
                        27806:20160524:164707.996 cannot set resource limit: [13] Permission denied
                        27806:20160524:164707.996 cannot disable core dump, exiting...

                        [root@localhost zabbix]# zabbix_server --version
                        zabbix_server (Zabbix) 3.0.3
                        Revision 60173 18 May 2016, compilation time: May 23 2016 04:50:56

                        Copyright (C) 2016 Zabbix SIA
                        License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
                        This is free software: you are free to change and redistribute it according to
                        the license. There is NO WARRANTY, to the extent permitted by law.
                        [root@localhost zabbix]#

                        Any idea what is causing this error ?

                        Thank you very much in advance.

                        Update : Saw some people mention might be related to the selinux. So i post my selinux status on below.
                        [root@localhost audit]# sestatus
                        SELinux status: enabled
                        SELinuxfs mount: /selinux
                        Current mode: permissive
                        Mode from config file: permissive
                        Policy version: 24
                        Policy from config file: targeted
                        [root@localhost audit]#
                        Last edited by Xyue; 24-05-2016, 11:38.

                        Comment

                        • Atsushi
                          Senior Member
                          • Aug 2013
                          • 2028

                          #13
                          Please try to disable SELinux.

                          Or, If you can read japanese, you can find hint for SELinux settings.
                          注意事項 先日公開していたAmazon Linux用のパッケージ「zabbix-3.0.1-2.amzn1.src.rpm」にはCentOS 6上でビルドする時に不備があったので、「zabbix-3.0.1-3.amzn1.src.rpm」を使ってください。 (2016/...

                          Comment

                          • Xyue
                            Member
                            • Jan 2016
                            • 93

                            #14
                            Hi Atsushi,

                            I tried to set the httpd_can_network and zabbix_can_network to on but still encounter same error.

                            So I have disabled the selinux as your advise but still having the same error.

                            [root@localhost ~]# sestatus
                            SELinux status: disabled

                            Below is the zabbix-server log. In the log i saw the connection to database server failed. Is it possible the issue caused by the mysql socket ?

                            2154:20160525:082330.920 using configuration file: /etc/zabbix/zabbix_server.conf
                            2154:20160525:082330.941 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
                            2154:20160525:082330.947 Got signal [signal:11(SIGSEGV),reason:1,refaddrnil)]. Crashing ...
                            2154:20160525:082330.947 ====== Fatal information: ======
                            2154:20160525:082330.947 Program counter: 0x36426375e2
                            2154:20160525:082330.947 === Registers: ===
                            2154:20160525:082330.947 r8 = 364298e5a0 = 233045550496 = 233045550496
                            2154:20160525:082330.947 r9 = 364298fed0 = 233045556944 = 233045556944
                            2154:20160525:082330.947 r10 = 0 = 0 = 0
                            2154:20160525:082330.947 r11 = 8 = 8 = 8
                            2154:20160525:082330.947 r12 = 0 = 0 = 0
                            2154:20160525:082330.947 r13 = 3644dd5180 = 233083588992 = 233083588992
                            2154:20160525:082330.947 r14 = 554ede = 5590750 = 5590750
                            2154:20160525:082330.947 r15 = 1897040 = 25784384 = 25784384
                            2154:20160525:082330.947 rdi = 0 = 0 = 0
                            2154:20160525:082330.947 rsi = 7fffb0cfb918 = 140736159791384 = 140736159791384
                            2154:20160525:082330.947 rbp = 3644e0e0a0 = 233083822240 = 233083822240
                            2154:20160525:082330.947 rbx = 0 = 0 = 0
                            2154:20160525:082330.947 rdx = a = 10 = 10
                            2154:20160525:082330.947 rax = 364298c260 = 233045541472 = 233045541472
                            2154:20160525:082330.947 rcx = 0 = 0 = 0
                            2154:20160525:082330.947 rsp = 7fffb0cfb8b0 = 140736159791280 = 140736159791280
                            2154:20160525:082330.947 rip = 36426375e2 = 233042048482 = 233042048482
                            2154:20160525:082330.947 efl = 10283 = 66179 = 66179
                            2154:20160525:082330.947 csgsfs = 33 = 51 = 51
                            2154:20160525:082330.947 err = 4 = 4 = 4
                            2154:20160525:082330.947 trapno = e = 14 = 14
                            2154:20160525:082330.947 oldmask = 0 = 0 = 0
                            2154:20160525:082330.947 cr2 = 0 = 0 = 0
                            2154:20160525:082330.947 === Backtrace: ===

                            I am lost as my previous staging zabbix does not have such error.

                            In the link you provide, it shows to install policycoreutils-python to assist in setting compilation and give authority to setrlimit ?

                            Appreciate your help on this. Thank you very much.

                            Comment

                            • Xyue
                              Member
                              • Jan 2016
                              • 93

                              #15
                              Hi Atsushi,

                              Somehow sort it out the error is due to the mysqld not running and socket is not there.

                              I tried to start the mysqld and socket appear.

                              Now i am trying to check the connection between web server and the database.

                              2880:20160525:112839.670 cannot set MySQL character set to "utf8"
                              2880:20160525:112839.670 database is down: reconnecting in 10 seconds
                              2880:20160525:112849.671 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

                              Comment

                              Working...