對於生產而言,使用即使不要求登錄憑證的solr管理員也感到不安全。我如何禁用默認出現的solr管理頁面?我只是想讓我的web應用程序使用Solr進行搜索詞索引。如何禁用solr管理頁面
回答
我強烈建議保留管理頁面用於調試目的。它在很多情況下拯救了我。有幾種方法可以將其限制爲僅限HTTP驗證的用戶:http://wiki.apache.org/solr/SolrSecurity#Jetty_example。你可能需要解壓並重新壓縮你的web應用程序。
但是,如果您仍想禁用整個管理部分,則可以在$ {SOLR_HOME} /project/solr/conf/solrconfig.xml中註釋掉admin requestHandler。
只需將安全約束添加到Solr Web應用程序,您就可以使用密碼保護您的管理頁面。
摘錄了Solr的3.6:
<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,你必須保護下列資源的管理界面:
/admin/*
/admin.html
最簡單的方法:
的iptables -A INPUT -p tcp --dport 8983 -j DROP
iptables -A INPUT -p tcp -s 127.0.0.1 --dport 8983 -j ACCEPT
用這個命令!
當我嘗試這個時,我的網站腳本不能再訪問Solr - 我嘗試了不同的ip地址和其他東西(可能是由於我缺乏這方面的專業知識)而無法使用iptables。 我仍然在尋找簡單的答案,沒有運氣做遠... – JxAxMxIxN
因爲錯誤的順序。這裏oneliner:'iptables -A INPUT -p tcp -s localhost --dport 8983 -j ACCEPT && iptables -A INPUT -p tcp --dport 8983 -j DROP && iptables-save> iptables.rules && iptables-restore
須藤的vim /opt/solr-4.8.1/example/etc/jetty.xml 變化
<!-- 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>
到
<!-- 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>
然後 須藤服務solrd重啓
- 1. 如何確保solr 6管理頁面
- 2. Solr管理頁面不加載
- 3. 我如何確保Solr 5.3.1只有管理頁面
- 4. 如何禁用公開訪問jamon管理頁面?
- 5. Solr的3.1管理界面
- 6. 如何使用WordPress管理頁面?
- 7. Codeigniter禁用管理面板的瀏覽器頁面緩存
- 8. 我如何禁用頁面
- 9. Asp.net頁面管理
- 10. Django管理頁面/
- 11. 管理Facebook頁面
- 12. 如何重寫Django管理頁面?
- 13. 如何管理liferay中的頁面?
- 14. 如何限制管理員頁面node.js
- 15. 如何加快Django管理頁面?
- 16. 如何到達Drupal的管理頁面
- 17. Apache Solr 5.1保護Web管理界面
- 18. 無法訪問服務器上的solr管理頁面
- 19. Solr的:404錯誤與得到的管理頁面
- 20. Apache Solr實現 - 無法訪問管理頁面
- 21. 在SOLR管理UI頁面中沒有更新NUM文檔
- 22. ASP.NET網頁管理頁面
- 23. Solr,管理實體
- 24. 如何管理/禁用Android 4.0上的主頁按鈕?
- 25. 如何禁用Wso2服務器中的管理界面?
- 26. 如何禁用django-rest-framework的管理式瀏覽界面?
- 27. 如何禁用SSRS 2008管理器
- 28. 如何禁用Django Celery管理模塊?
- 29. 如何爲主廚管理禁用SSL?
- 30. 如何禁用rails管理員的has_many_association?
在哪文件添加此片段? – tasmaniski
這將是web.xml。我不確定碼頭的配置。 – Maddin