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

如何禁用solr管理页面
EN

Stack Overflow用户
提问于 2012-05-28 02:28:57
回答 4查看 11.5K关注 0票数 8

对于生产环境,使用solr管理员甚至不要求登录凭据是不安全的。如何禁用默认的solr管理页面?我只是想让我的webapp使用Solr进行搜索词索引。

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2012-05-28 02:57:15

为了调试的目的,我强烈建议保留管理页面。在许多情况下,它拯救了我。有几种方法可以将其限制为仅限经过HTTP身份验证的用户使用:http://wiki.apache.org/solr/SolrSecurity#Jetty_example。您可能需要解压缩并重新压缩您的webapp应用程序。

但是,如果您仍然希望禁用整个管理部分,可以注释掉${SOLR_HOME}/ requestHandler /solr/conf/solrconfig.xml中的管理项目。

票数 10
EN

Stack Overflow用户

发布于 2012-11-23 21:45:42

您可以使用密码保护您的管理页面,只需向Solr web应用程序添加安全约束即可。

Solr 3.6的代码片段:

代码语言:javascript
复制
  <security-constraint>
    <!-- This protects your admin interface and grants access to role Solr-Admin -->
    <web-resource-collection>
    <web-resource-name>Solr admin</web-resource-name>
      <!--url-pattern>/admin/*</url-pattern-->
      <url-pattern>/evu/admin/*</url-pattern>
      <url-pattern>/webcrawl/admin/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>Solr-Admin</role-name>
    </auth-constraint>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

  <security-constraint>
    <!-- This protects your admin interface and grants access to roles Solr-Admin and Solr-Updater -->
    <web-resource-collection>
      <web-resource-name>Solr Update</web-resource-name>
      <url-pattern>/update/*</url-pattern>
      <url-pattern>/evu/update/*</url-pattern>
      <url-pattern>/webcrawl/update/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>Solr-Admin</role-name>
      <role-name>Solr-Update</role-name>
    </auth-constraint>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

  <security-constraint>
    <!-- This one is necessary to show the image on the Solr start page -->
    <web-resource-collection>
      <web-resource-name>Solr Admin images</web-resource-name>
      <url-pattern>*.png</url-pattern>
    </web-resource-collection>
    <auth-contraint>
      <role-name>*</role-name>
    </auth-contraint>
  </security-constraint>

  <security-role>
    <description>The role that is required to administer Solr</description>
    <role-name>Solr-Admin</role-name>
  </security-role>
  <security-role>
    <description>The role that is required to update the Solr index</description>
    <role-name>Solr-Update</role-name>
  </security-role>

  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Solr</realm-name>
  </login-config>
</web-app>

在Solr 4中,您必须为管理界面保护以下资源:

代码语言:javascript
复制
/admin/*
/admin.html
票数 2
EN

Stack Overflow用户

发布于 2016-12-01 17:05:19

sudo vim /opt/solr-4.8.1/example/etc/jetty.xml更改

代码语言:javascript
复制
  <!-- This connector is currently being used for Solr because it
          showed better performance than nio.SelectChannelConnector
          for typical Solr requests.  -->
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.bio.SocketConnector">
            <Set name="host">0.0.0.0</Set>
            <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
            <Set name="maxIdleTime">50000</Set>
            <Set name="lowResourceMaxIdleTime">1500</Set>
            <Set name="statsOn">false</Set>
          </New>
      </Arg>
    </Call>

代码语言:javascript
复制
 <!-- This connector is currently being used for Solr because it
          showed better performance than nio.SelectChannelConnector
          for typical Solr requests.  -->
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.bio.SocketConnector">
            <Set name="host">127.0.0.1</Set>
            <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
            <Set name="maxIdleTime">50000</Set>
            <Set name="lowResourceMaxIdleTime">1500</Set>
            <Set name="statsOn">false</Set>
          </New>
      </Arg>
    </Call>

然后sudo service solrd重启

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

https://stackoverflow.com/questions/10776263

复制
相关文章

相似问题

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