【问题标题】:Apache2: Password protected directory - website cannot connect to its own serverApache2:受密码保护的目录 - 网站无法连接到自己的服务器
【发布时间】:2012-09-05 11:09:26
【问题描述】:

我已使用密码 (.htaccess + .htpasswd) 保护了我的网站所在的目录。保护就像一个魅力。但是,有一个问题。在同一个域上,我设置了 SOLR 服务器,并且我的网站使用远程连接从中检索数据(即 PHP 的 file_get_contents)。不幸的是,这不起作用,因为它也受密码保护。

如何让我的服务器在没有 HTTP 身份验证的情况下连接到自身?有可能吗?

非常感谢!

【问题讨论】:

    标签: apache .htaccess password-protection .htpasswd


    【解决方案1】:

    添加行

    Allow from 192.168.0.1/24
    

    到 Auth 定义。 Require valid-user之后是个好地方。如有必要,更改 ip 号。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-02
      • 1970-01-01
      • 2015-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-28
      相关资源
      最近更新 更多