Ad Widget

Collapse

a remote server for the database and another for the frontend

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Potato-Warrior
    Junior Member
    • May 2023
    • 12

    #1

    a remote server for the database and another for the frontend

    so i need to have a zabbix-setup with a remote database server , remote frontend and remote backend (zabbix server) all three of them in seperate end devices . but i dont know how to change the ipaddress for both of them in the zabbix-server so that they are connected. i found a other post that had a kind of similar situation but with just a remote database.

    How to create Zabbix DB on remote Server - ZABBIX Forums

    however what was suggested there i couldnt use cuz it changed? updated?
    i was suppose to "nano /etc/zabbix/zabbix_server.conf" and then find dbhost and change or put in my ip. but i couldnt even find it (im using ubuntu-server 22.04.2 LTS for all three servers and im using mysql for the database)

    how can i do this?
  • incama
    Member
    • Jan 2015
    • 65

    #2
    Just point the application server and webinterface to the new database server. The file for the webinterface is zabbix-conf.php (location depends on what webserver you use). The config of the Zabbix application can be found in /etc/zabbix/ and is normally called zabbix_server.conf.

    Comment

    • Potato-Warrior
      Junior Member
      • May 2023
      • 12

      #3
      i think i pointed the application server to the Database.

      ### Option: DBHost
      # Database host name.
      # If set to localhost, socket is used for MySQL.
      # If set to empty string, socket is used for PostgreSQL.
      # If set to empty string, the Net Service Name connection method is used to connect to Oracle database; also see
      # the TNS_ADMIN environment variable to specify the directory where the tnsnames.ora file is located.
      #
      # Mandatory: no
      # Default:
      DBHost= DATABASE IP

      but i cant find the way to do it in the webinterface i dont know how to navigate the directory's really. im using apache​

      Comment

      • Potato-Warrior
        Junior Member
        • May 2023
        • 12

        #4
        This is what i get when i put in nano /etc/zabbix/apache.conf
        am i supposed to change something here?
        and im not finding zabbix-conf.php anywhere

        # Define /zabbix alias, this is the default
        <IfModule mod_alias.c>
        Alias /zabbix /usr/share/zabbix
        </IfModule>

        <Directory "/usr/share/zabbix">
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all

        <IfModule mod_php.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 max_input_vars 10000
        php_value always_populate_raw_post_data -1
        </IfModule>

        <IfModule mod_php7.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 max_input_vars 10000
        php_value always_populate_raw_post_data -1
        </IfModule>
        </Directory>

        <Directory "/usr/share/zabbix/conf">
        Order deny,allow
        Deny from all
        <files *.php>
        Order deny,allow
        Deny from all
        </files>
        </Directory>

        <Directory "/usr/share/zabbix/app">
        Order deny,allow
        Deny from all
        <files *.php>
        Order deny,allow
        Deny from all
        </files>
        </Directory>

        <Directory "/usr/share/zabbix/include">
        Order deny,allow
        Deny from all
        <files *.php>
        Order deny,allow
        Deny from all
        </files>
        </Directory>

        <Directory "/usr/share/zabbix/local">
        Order deny,allow
        Deny from all
        <files *.php>
        Order deny,allow
        Deny from all
        </files>
        </Directory>

        <Directory "/usr/share/zabbix/vendor">
        Order deny,allow
        Deny from all
        <files *.php>
        Order deny,allow
        Deny from all
        </files>
        </Directory>

        idk if this might be usefull

        root@zabbix-app02:/home/awais# tree
        .
        └── zabbix-release_6.4-1+ubuntu22.04_all.deb

        0 directories, 1 file
        root@zabbix-app02:/home/awais# tree -d
        .

        0 directories
        root@zabbix-app02:/home/awais# nano ./zabbix-release_6.4-1+ubuntu22.04_all.deb
        root@zabbix-app02:/home/awais# /etc/zabbix/web/zabbix.conf.php.
        bash: /etc/zabbix/web/zabbix.conf.php.: No such file or directory
        root@zabbix-app02:/home/awais# /etc/zabbix/web/zabbix
        bash: /etc/zabbix/web/zabbix: No such file or directory
        root@zabbix-app02:/home/awais# nano /etc/zabbix/web/
        root@zabbix-app02:/home/awais# nano /etc/zabbix/web
        root@zabbix-app02:/home/awais# nano /etc/zabbix
        root@zabbix-app02:/home/awais# tree -t /etc/zabbix
        /etc/zabbix
        ├── apache.conf
        ├── web
        ├── zabbix_agentd.conf
        └── zabbix_agentd.d


        Last edited by Potato-Warrior; 08-05-2023, 15:18.

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          Based upon the information you show here:

          Originally posted by Potato-Warrior
          <Directory "/usr/share/zabbix/conf">
          Order deny,allow
          Deny from all
          <files *.php>
          Order deny,allow
          Deny from all
          </files>
          </Directory>
          your Zabbix web front-end uses /usr/share/zabbix/conf as its configuration directory for PHP. Look in there for a zabbix.conf.php or something similar (ignore the example file). It's that file that tells the web application how to connect to the database.

          Comment

          • Potato-Warrior
            Junior Member
            • May 2023
            • 12

            #6

            ​okay so since i couldn't get to the web interface i decided to try out putting everything in 1 server like the zabbix tutorial (this is my first time using zabbix) and i couldnt get on the web interface. which was weird since it should word so i asked my it administrator if it may be a firewall. it was indeed a firewall so now i can do the setup. so i do the wizard until i get to CONFIGURE DB CONNECTION and i get this error
            Click image for larger version  Name:	2023-05-10 10_46_32-Installation.png Views:	0 Size:	35.9 KB ID:	464236

            do i have to change something in a file in the database? maybe the permissions i gave in mysql ?
            and thanks to everyone that has helped already. really appreciate it
            tim.mooney i think the reason i couldn't find it was cuz i didnt do the web interface setup yet.​

            i also found this post

            https://www.zabbix.com/forum/zabbix-...om-remote-site


            "Hi,

            Make sure that mysql is not restricted to 127.0.0.1.
            You said that you checked with netstat but didn't show the output
            Code:netstat -tlnp | grep mysqld
            should look like:
            Code:tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
            but not
            Code:tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
            In this case, you can change it with bind-address parameter in my.cnf
            Code:bind-address = 0.0.0.0
            Since connecting to mysql has nothing specific to Zabbix, if you still have problems you could check Mysql documentation or do a quick google search («mysql remote connection» returns more than 25 million results, the answer is probably there )

            Regards,
            JBo"

            i dont know how to change i went in /etc/mysql/my.cnf and just pasted "bind-address = 0.0.0.0" didnt change
            edit: i think i did it wrong it made my mysql server crash on my database server just removed it.
            ​​
            Last edited by Potato-Warrior; 10-05-2023, 16:41.

            Comment

            • Potato-Warrior
              Junior Member
              • May 2023
              • 12

              #7
              guys i have made a great improvement today. this is what i used.

              How To Allow Remote Access to MySQL | DigitalOcean

              and my thanks to everyone that has helped me.

              Comment

              Working...