简体   繁体   中英

zabbix configuration with rails and nginx server

Am running rails on nginx server in production. I want to use zabbix to monitor my server. Anybody with a working nginx configuration of zabbix. I have found these https://www.zabbix.com/forum/showthread.php?t=40612 https://www.zabbix.com/forum/showthread.php?t=40564 but i have become confused and they are not working.

To install and run zabbix PHP frontend under nginx you need to:

  1. Install php-fpm:

    yum|apt-get|whatever php-fpm

there can be php components the frontend depends on, but I don't remember which ones. See here .

  1. Add a separate server configuration to nginx with fastcgi to php-fpm:

    server {

     server_name zabbix.your.domain.com; access_log /home/tlpls/prtp/logs/access.log main; #IMPORTANT: this is where you look for errors and such error_log /home/tlpls/prtp/logs/error.log debug; #this is for the static files #should point to where your zabbix frontend files are location / { root /usr/share/zabbix; index index.php index.html index.htm; } #and this is what to do with php files #same paths probably location ~ \\.php$ { root /usr/share/zabbix; fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/zabbix$fastcgi_script_name; include fastcgi_params; } 

    }

True story ^^^^^^

  1. Start php-fpm (/etc/init.d/php-fpm start or something) and reload nginx (nginx -s reload or something)

There you go, can't be more complete of a howto, as @StephenKing already said in the comments, it is just a PHP application for which there are tons of explanations how to setup under nginx including the official nginx documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM