【问题标题】:monit and apache site behind http-basic-authhttp-basic-auth 后面的monit和apache站点
【发布时间】:2009-07-12 11:04:36
【问题描述】:

我有一个受 http-basic-auth 保护的 Web 服务器。我已经阅读了 monit 文档,但似乎没有一种明确的方法可以传递凭据以测试服务器上的测试页面是否正确返回。

有什么想法吗?

谢谢!

(请不要将此与monit自己的httpd混淆,用于在网页中显示monit状态)

PS 这是 monit 4.8.1 -- Ubuntu Hardy 8.04 附带的

【问题讨论】:

    标签: monitoring ubuntu-8.04


    【解决方案1】:

    似乎可以在 URL 中包含凭据,您尝试过吗?:

    (来自http://mmonit.com/monit/documentation/monit.html#connection_testing

    [...] 其中 URL-spec 是 RFC 中指定的标准格式 2396:

    <protocol>://<authority><path>?<query>

    这是一个 URL 示例,其中所有 使用组件:

    http://user:password@www.foo.bar:8080/document/?querystring#ref

    如果包含用户名和密码 在 URL Monit 将尝试登录 在服务器上使用 Basic 身份验证。

    【讨论】:

    • 不错,是的,这是有道理的。我被卡住了,因为默认情况下没有指定 URL,但是 monit 文档确实说你可以这样做:“你可以使用紧凑的 URL 语法测试 HTTP 服务器。这个测试还允许你使用 POSIX 正则表达式来测试返回的内容由 HTTP 服务器。” mmonit.com/monit/documentation/monit.html 手指交叉,我看看这是否适用于 monit 4.8.1!
    【解决方案2】:

    如果您只想检查您的网络服务器是否正在侦听端口 80(并且您不在乎它返回什么页面或数据),请尝试此操作:

    if failed port 80 type TCP then restart
    

    【讨论】:

      猜你喜欢
      • 2012-12-23
      • 1970-01-01
      • 2013-07-15
      • 1970-01-01
      • 2015-10-15
      • 2013-07-01
      • 1970-01-01
      • 2018-06-15
      • 2010-11-30
      相关资源
      最近更新 更多