首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何保护solr 6管理页面

如何保护solr 6管理页面
EN

Stack Overflow用户
提问于 2016-08-02 20:55:19
回答 2查看 4.1K关注 0票数 1

在Ubuntu14上安装了Solr6.1,并从MySql表中导入数据。有没有人能指导我如何保护mydomain/ip:8983/solr不被公开。

我尝试了在https://cwiki.apache.org/confluence/display/solr/Basic+Authentication+Plugin上给出的指令,但在添加security.json时zookeepr连接失败。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-08-03 04:10:22

首先,转到etc目录中的webdefault.xml。在你的web.xml中添加以下几行代码。

代码语言:javascript
复制
<login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>samplerealm</realm-name>
    </login-config>

 <security-constraint>
        <web-resource-collection>
            <web-resource-name>Secure resources</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>user</role-name>
        </auth-constraint>
    </security-constraint>

etc文件夹中,创建一个samplerealm.txt文件并将以下内容添加到文件user1: user1pass,user中。这里,user1是您的用户名,user1pass是您刚才在web.xml中定义的角色user的密码。之后,转到etc文件夹中的jetty.xml文件,在该行下面查找以下行<Configure id="Server" class="org.eclipse.jetty.server.Server">,粘贴以下代码:

代码语言:javascript
复制
  <Call name="addBean">
    <Arg>
      <New class="org.eclipse.jetty.security.HashLoginService">
        <Set name="name">samplerealm</Set>
        <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/samplerealm.txt</Set>
        <Set name="refreshInterval">0</Set>
      </New>
    </Arg>
  </Call>

之后,停止并重新启动Solr服务器。当您现在访问solr页面时,它会要求您提供凭据。按照示例realm.txt文件中的声明,提供user1作为用户名,user1pass作为密码。稍后,您可以根据需要更改密码。这就是在Solr中执行http基本身份验证的方法。它100%有效。如果有帮助,请告诉我:)

票数 3
EN

Stack Overflow用户

发布于 2016-08-02 21:09:23

您可以启用SSL。我不确定这是否是所需的安全性-您必须提供更多信息。

使用SSL,您至少能够加密SolrCloud和客户端之间的通信,以及Solr节点之间的通信。

启用SSL的链接:https://cwiki.apache.org/confluence/display/solr/Enabling+SSL

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38721049

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档