Linode longview在Debian下的Apache2.4自动配置似乎有点问题,总是显示无法访问server-status页面,而官方文档也没有写明白,只能自己动手尝试,终于配置成功,最后发现原来问题出在Longview的配置文件用的默认接口上。
1.启用mod_status
1 |
a2enmod status |
2.进入 /etc/apache2/mods-available 找到status.conf
确认文件内容如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<IfModule mod_status.c> # Allow server status reports generated by mod_status, # with the URL of http://servername/server-status # Uncomment and change the "192.0.2.0/24" to allow access from other hosts. <Location /server-status> SetHandler server-status Require local #Require ip 192.0.2.0/24 </Location> # Keep track of extended status information for each request ExtendedStatus On # Determine if mod_status displays the first 63 characters of a request or # the last 63, assuming the request itself is greater than 63 chars. # Default: Off #SeeRequestTail On <IfModule mod_proxy.c> # Show Proxy LoadBalancer status in mod_status ProxyStatus On </IfModule> </IfModule> |
3.打开 /etc/linode/longview.d/Apache.conf
内容如下
1 |
location http://127.0.0.1/server-status?auto |
修改为
1 |
location http://dev.minirplus.com/server-status |
即把原来的127.0.0.1修改为本机域名或IP地址,以及删去最后的?auto
4.重启Longview和Apache服务
1 2 |
service longview restart service apache2 restart |
5.进入Linode Longview查看是否已配置成功,成功后的Apache页面显示如下
Debug方法
把status.conf中的Require local前加上#注释,就可以直接通过外部网络访问http://dev.minirplus.com/server-status来验证配置是否成功,待配置完成之后,删除注释即可阻止外部访问,仅允许Longview从本地访问。
There are no comments yet