Hello All. We are setting up Zabbix with Nginx/Posgres combo as Frontend/Backend(Same Server).
Created initial DB as per Zabbix documentation:
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
Imported initial schema and data:
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql Zabbix
Configure DB for Zabbix.
After that stuck, as the manual has no info on how to configure Nginx for Zabbix further.
Nginx-1.27.4 was installed successfully manually via nginx-1.27.4.tar and pcre2-10.45.tar.
# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.27.4
built by gcc 11.4.1 20231218 (Red Hat 11.4.1-3) (GCC)
configure arguments: --with-http_stub_status_module
./configure; make; 'make install' were run for both Nginx & PCRE, with no errors at all.
# ps -eaf | grep -i nginx
root 69056 1 0 Mar19 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx 69057 69056 0 Mar19 ? 00:00:00 nginx: worker process
root 183791 183091 0 10:14 pts/0 00:00:00 grep --color=auto -i nginx
# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
But not sure what will be the next steps to do. also, it gives error Unit nginx.service not found.
# sudo systemctl status nginx
Unit nginx.service could not be found.
# sudo systemctl start nginx
Failed to start nginx.service: Unit nginx.service not found. <= This Unit nginx.service not found has been now resolved: UPDATE
So, the issue mentioned earlier(Unit nginx.service not found) has been resolved as of now. From a non-zabbix google search, a file was modified at this location: /lib/systemd/system/nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
And, then restarting nginx brought back it up fine.
http:/<IP Address>
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
# sudo systemctl restart nginx
# sudo systemctl status nginx
● nginx.service - The NGINX HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; preset: disabled)
Active: active (running) since Thu 2025-03-20 15:26:59 -05; 9s ago
Process: 230537 ExecStartPre=/usr/local/nginx/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 230539 ExecStart=/usr/local/nginx/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 230540 (nginx)
Tasks: 2 (limit: 203362)
Memory: 1.6M
CPU: 13ms
CGroup: /system.slice/nginx.service
├─230540 "nginx: master process /usr/local/nginx/sbin/nginx"
└─230541 "nginx: worker process"
Mar 20 15:26:59 somebody.corp systemd[1]: Starting The NGINX HTTP and reverse proxy server...
Mar 20 15:26:59 somebody.corp nginx[230537]: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
Mar 20 15:26:59 somebody.corp nginx[230537]: nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Mar 20 15:26:59 somebody.corp systemd[1]: Started The NGINX HTTP and reverse proxy server.
As per Zabbix manual, next steps is to Configure PHP for Zabbix frontend, but I don't find zabbix.conf file in the system
Please advise on the next steps. Thanks in advance.
Created initial DB as per Zabbix documentation:
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
Imported initial schema and data:
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql Zabbix
Configure DB for Zabbix.
After that stuck, as the manual has no info on how to configure Nginx for Zabbix further.
Nginx-1.27.4 was installed successfully manually via nginx-1.27.4.tar and pcre2-10.45.tar.
# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.27.4
built by gcc 11.4.1 20231218 (Red Hat 11.4.1-3) (GCC)
configure arguments: --with-http_stub_status_module
./configure; make; 'make install' were run for both Nginx & PCRE, with no errors at all.
# ps -eaf | grep -i nginx
root 69056 1 0 Mar19 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx 69057 69056 0 Mar19 ? 00:00:00 nginx: worker process
root 183791 183091 0 10:14 pts/0 00:00:00 grep --color=auto -i nginx
# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
But not sure what will be the next steps to do. also, it gives error Unit nginx.service not found.
# sudo systemctl status nginx
Unit nginx.service could not be found.
# sudo systemctl start nginx
Failed to start nginx.service: Unit nginx.service not found. <= This Unit nginx.service not found has been now resolved: UPDATE
So, the issue mentioned earlier(Unit nginx.service not found) has been resolved as of now. From a non-zabbix google search, a file was modified at this location: /lib/systemd/system/nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
And, then restarting nginx brought back it up fine.
http:/<IP Address>
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
# sudo systemctl restart nginx
# sudo systemctl status nginx
● nginx.service - The NGINX HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; preset: disabled)
Active: active (running) since Thu 2025-03-20 15:26:59 -05; 9s ago
Process: 230537 ExecStartPre=/usr/local/nginx/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 230539 ExecStart=/usr/local/nginx/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 230540 (nginx)
Tasks: 2 (limit: 203362)
Memory: 1.6M
CPU: 13ms
CGroup: /system.slice/nginx.service
├─230540 "nginx: master process /usr/local/nginx/sbin/nginx"
└─230541 "nginx: worker process"
Mar 20 15:26:59 somebody.corp systemd[1]: Starting The NGINX HTTP and reverse proxy server...
Mar 20 15:26:59 somebody.corp nginx[230537]: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
Mar 20 15:26:59 somebody.corp nginx[230537]: nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Mar 20 15:26:59 somebody.corp systemd[1]: Started The NGINX HTTP and reverse proxy server.
As per Zabbix manual, next steps is to Configure PHP for Zabbix frontend, but I don't find zabbix.conf file in the system
Please advise on the next steps. Thanks in advance.
Comment