Skip to content

Deployment Overview of Zabbix Proxy on Server

Prerequisites and Basic Requirements

The deployment of the Zabbix Proxy requires the following system specifications and configurations:

  • Operating System: Ubuntu 22.04 (implied by the package repository path ubuntu22.04).

  • Privileges: Root access is required to install packages, configure services, and manage Docker containers.

  • Dependencies: The system must have ca-certificates, curl, gnupg, and apt-transport-https installed to access the Zabbix repository.

  • Network: The server must have outbound internet access to download packages and certificates.

FQDN of the Final Panel

The application is accessible via the hostkey.in domain using the following format:

  • Format: zabbixproxy<Server ID>.hostkey.in:443

  • Protocol: HTTPS (Port 443)

  • Internal Path: /

  • External Path: /

File and Directory Structure

The deployment utilizes the following directory structure for configuration, data, and certificates:

  • Configuration Files:

  • /etc/zabbix/zabbix_proxy.conf: Main Zabbix Proxy configuration.

  • /root/nginx/compose.yml: Docker Compose definition for the reverse proxy.

  • /data/nginx/user_conf.d/zabbixproxy<Server ID>.hostkey.in.conf: Nginx site-specific configuration.

  • /data/nginx/nginx-certbot.env: Environment variables for the Nginx-Certbot container.

  • Data Storage:

  • /var/lib/zabbix/: Directory for Zabbix Proxy data and SQLite database files.

  • /etc/letsencrypt: Volume mount for SSL certificates managed by Docker.

  • Docker Volumes:

  • nginx_secrets: External volume storing SSL certificates.

Application Installation Process

The Zabbix Proxy is installed using the official Zabbix repository for Ubuntu. The installation process involves the following steps:

  1. Repository Setup: The system adds the Zabbix repository for version 7.0.

  2. Package Installation:

    • If using SQLite: zabbix-proxy-sqlite3 and zabbix-sql-scripts are installed.

    • If using MySQL: zabbix-proxy-mysql is installed.

    • If using PostgreSQL: zabbix-proxy-pgsql is installed.

  3. Service Initialization: The zabbix-proxy service is enabled and started automatically.

Databases

The Zabbix Proxy connects to a database based on the selected backend. The configuration is stored in /etc/zabbix/zabbix_proxy.conf.

Parameter SQLite Value MySQL/PostgreSQL Value
DBName /var/lib/zabbix/zabbix_proxy.db zabbix_proxy
DBUser N/A zabbix
DBPassword N/A zabbix
DBHost N/A 127.0.0.1

Docker Containers and Their Deployment

A reverse proxy is deployed using Docker Compose to handle SSL termination and routing.

  • Image: jonasal/nginx-certbot:latest

  • Compose File Location: /root/nginx/compose.yml

  • Network Mode: host

  • Volumes:

  • nginx_secrets mounted to /etc/letsencrypt inside the container.

  • /data/nginx/user_conf.d mounted to /etc/nginx/user_conf.d inside the container.

  • Environment:

  • CERTBOT_EMAIL: Set to [email protected].

  • Configuration loaded from /data/nginx/nginx-certbot.env.

Proxy Servers

The Nginx container acts as a reverse proxy for the Zabbix Proxy application.

  • SSL/TLS: Managed automatically by the nginx-certbot container using Let's Encrypt.

  • Routing:

  • The Nginx configuration file located at /data/nginx/user_conf.d/zabbixproxy<Server ID>.hostkey.in.conf is updated to include a proxy_pass directive.

  • Traffic is forwarded from the external port 443 to the internal Zabbix Proxy instance at http://127.0.0.1:8083.

  • Configuration Update: The proxy_pass line is dynamically inserted into the location block of the Nginx configuration.

Permission Settings

File and directory permissions are set as follows to ensure security and proper operation:

  • Zabbix Data Directory:

  • Path: /var/lib/zabbix

  • Owner: zabbix

  • Group: zabbix

  • Mode: 0750

  • Nginx Configuration Directory:

  • Path: /root/nginx

  • Owner: root

  • Group: root

  • Mode: 0755

  • Docker Compose File:

  • Path: /root/nginx/compose.yml

  • Owner: root

  • Group: root

  • Mode: 0644

Location of Configuration Files and Data

Key configuration and data files are located in the following paths:

  • Zabbix Proxy Config: /etc/zabbix/zabbix_proxy.conf

  • SQLite Database: /var/lib/zabbix/zabbix_proxy.db

  • Nginx Compose: /root/nginx/compose.yml

  • Nginx Site Config: /data/nginx/user_conf.d/zabbixproxy<Server ID>.hostkey.in.conf

  • Nginx Environment: /data/nginx/nginx-certbot.env

Available Ports for Connection

The following ports are utilized by the deployment:

  • Port 443: HTTPS traffic for the web interface (external access via Nginx).

  • Port 8083: Internal HTTP traffic for the Zabbix Proxy (accessed by Nginx).

  • Port 8080: Defined in configuration variables but currently routed via Nginx to port 8083.

Starting, Stopping, and Updating

Service management commands for the Zabbix Proxy and Docker containers are as follows:

Zabbix Proxy Service:

  • Start: systemctl start zabbix-proxy

  • Stop: systemctl stop zabbix-proxy

  • Restart: systemctl restart zabbix-proxy

  • Enable on Boot: systemctl enable zabbix-proxy

Docker Reverse Proxy:

  • Start/Update: docker compose up -d (executed from /root/nginx)

  • Stop: docker compose down (executed from /root/nginx)

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×