munin nginx:没有dynazoom成图
我无法让Munin动态变焦工作.我确信这个问题与Nginx配置有关.任何生成缩放图的尝试都会在nginx日志中触发以下错误条目:
具体来说,我怀疑fastCGI参数有问题.愿一个好友好的灵魂看看我的Munin虚拟服务器(见下文)并向我解释有什么问题?它让我发疯 – 但我有预感,任何专家都会在不到一秒的时间内发现问题……
最佳答案
我在寻找解决问题和好消息的同时找到了这个!我解决了我的问题.我希望这也可以帮助你让munin在你的设置上工作.
要求: >从https://github.com/lighttpd/spawn-fcgi克隆或下载邮政编码 autoreconf -v -i >编译和安装: ./configure && make && sudo make install >初始化脚本(我不做systemd所以弄清楚如何制作服务): #! /bin/sh ### BEGIN INIT INFO # Provides: munin-fastcgi # Required-Start: $remote_fs $network # Required-Stop: $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts munin-fastcgi # Description: Spawn Munin FCGI sockets for Web access ### END INIT INFO # # munin-fastcgi Startup script for Munin CGI services # # chkconfig: - 84 15 # description: Loading Munin CGI services using spawn-cgi # HTML files and CGI. # # Author: Ryan Norbauer # Modified: Geoffrey Grosenbach http://topfunky.com # Modified: David Krmpotic http://davidhq.com # Modified: Kun Xi http://kunxi.org # Modified: http://drumcoder.co.uk/ # Modified: http://uname.pingveno.net/ # Modified: the_architecht http://iwbyt.com/ PATH=/usr/local/bin/:/usr/local/sbin:$PATH DAEMON=$(which spawn-fcgi) FCGI_GRAPH_SOCK=/var/run/munin/fastcgi-munin-graph.sock FCGI_HTML_SOCK=/var/run/munin/fastcgi-munin-html.sock WWW_USER=www-data FCGI_USER=www-data FCGI_GROUP=www-data FCGI_SPAWN_GRAPH=/usr/lib/munin/cgi/munin-cgi-graph FCGI_SPAWN_HTML=/usr/lib/munin/cgi/munin-cgi-html PIDFILE_GRAPH=/var/run/munin/fastcgi-munin-graph.pid PIDFILE_HTML=/var/run/munin/fastcgi-munin-html.pid DESC="Munin FCGI for Graph and HTML" # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 test -x $FCGI_SPAWN_GRAPH || exit 0 test -x $FCGI_SPAWN_HTML || exit 0 start() { $DAEMON -s $FCGI_GRAPH_SOCK -U $WWW_USER -u $FCGI_USER -g $FCGI_GROUP -P $PIDFILE_GRAPH $FCGI_SPAWN_GRAPH 2> /dev/null || echo "Graph Already running" $DAEMON -s $FCGI_HTML_SOCK -U $WWW_USER -u $FCGI_USER -g $FCGI_GROUP -P $PIDFILE_HTML $FCGI_SPAWN_HTML 2> /dev/null || echo "HTML Already running" } stop() { kill -QUIT `cat $PIDFILE_GRAPH` || echo "Graph not running" kill -QUIT `cat $PIDFILE_HTML` || echo "HTML Not running" } restart() { kill -HUP `cat $PIDFILE_GRAPH` || echo "Can't reload Graph" kill -HUP `cat $PIDFILE_HTML` || echo "Can't reload HTML" } case "$1" in start) echo "Starting $DESC: " start ;; stop) echo "Stopping $DESC: " stop ;; restart|reload) echo "Restarting $DESC: " stop # One second might not be time enough for a daemon to stop,# if this happens,d_start will fail (and dpkg will break if # the package is being upgraded). Change the timeout if needed # be,or change d_stop to have start-stop-daemon use --retry. # Notice that using --retry slows down the shutdown process somewhat. sleep 1 start ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2 exit 3 ;; esac exit $? 在/etc/init.d/munin-fcgi下安装上面的权限755 >在您的虚拟主机中,例如/etc/nginx/conf.d/example.com.conf,将其添加到server {}块中.您可以更改允许的ip块以适合您的设置.我在本地服务器上做了这个,并希望munin图只能在本地使用. location /munin { # alias /var/cache/munin/www; index index.html; # include /etc/nginx/php.conf; # access_log off; allow 127.0.0.1; allow 192.168.0.0/16; deny all; } location ^~ /munin-cgi/munin-cgi-graph/ { # if ($uri ~ /munin-cgi/munin-cgi-graph/([^/]*)) { set $path $1; } fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*); fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass unix:/var/run/munin/fastcgi-munin-graph.sock; include fastcgi_params; } location ^~ /munin-cgi/munin-cgi-html/ { # if ($uri ~ /munin-cgi/munin-cgi-html/([^/]*)) { set $path $1; } fastcgi_split_path_info ^(/munin-cgi/munin-cgi-html)(.*); fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass unix:/var/run/munin/fastcgi-munin-html.sock; include fastcgi_params; } >启动/etc/init.d/munin-fcgi启动并重新加载nginx然后你就可以了. p.s我将munin的html文件夹链接到我的vhost文件夹:ln -s / var / cache / munin / www / /var/www/example.com/munin -v. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |