簡體   English   中英

如何保護Solr 6管理頁面

[英]How to secure solr 6 admin page

在Ubuntu14上安裝Solr6.1,並從MySql表導入數據。 有人可以指導我如何保護mydomain / ip:8983 / solr免受公眾訪問。

我嘗試了https://cwiki.apache.org/confluence/display/solr/Basic+Authentication+Plugin上給出的說明,但是在添加security.json時Zookeepr連接失敗。

首先轉到etc目錄中的webdefault.xml 在您的web.xml中放入以下行。

<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">在此行下方粘貼以下代碼:

  <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%。 讓我知道是否有幫助:)

您可以啟用SSL。 我不確定這是否是所需的安全性-您必須提供更多信息。

使用SSL,您將能夠至少加密SolrCloud與客戶端之間的通信以及Solr節點之間的通信。

啟用S​​SL的鏈接: https : //cwiki.apache.org/confluence/display/solr/Enabling+SSL

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM