Jetty/SOLR 管理面板密码 [英] Jetty/SOLR Admin Panel Password
问题描述
我正在使用 jetty 在 SOLR 管理面板上应用身份验证.我已经阅读了很多教程并使用以下步骤实现:
I am applying authentication on SOLR Admin Panel using jetty. I have read so many tutorials and implemented using following steps:
在/solr/core/etc/jetty.xml中添加如下代码:
Added following code in /solr/core/etc/jetty.xml :
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">Test Realm</Set>
<Set name="config"><SystemProperty name="jetty.home" default="."/>/var/www/solr/core/etc/realm.properties</Set>
<Set name="refreshInterval">0</Set>
</New>
</Arg>
</Call>
在/solr/core/solr-webapp/webapp/WEB-INF/web.xml中添加如下代码:
Added following code in /solr/core/solr-webapp/webapp/WEB-INF/web.xml:
<security-constraint>
<web-resource-collection>
<web-resource-name>Solr authenticated application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Test Realm</realm-name>
</login-config>
然后使用以下代码行在 solr/core/etc 中创建文件realm.proprerties 文件:
And then created file realm.proprerties file in solr/core/etc with following line of code:
admin: OBF:1y0s1v1p1v2p1y0y, admin
但是当我使用 URL http://localhost:8983/solr/ 打开 solr 管理面板时.我有一个弹出窗口询问用户名和密码.我填写了在realm.properties 中添加的用户名和密码.但无法登录.
But when I open solr admin panel using URL http://localhost:8983/solr/. I got a popup asking username and password. I fill username and password as I have added in realm.properties. But unable to login.
请帮我找出我错在哪里.
Please help me figuring out where I am wrong.
推荐答案
在你的 realm.properties 文件中定义用户为:
In your realm.properties file define the user as:
ex: admin: 12345, admin
还要检查您的 "jetty.home"
路径.它应该是 SOLR 核心文件夹中的etc"目录.
Also check your "jetty.home"
path. It should be the 'etc' directory in your SOLR core folder.
同样在realm.properties中,你应该在散列后输入你的密码&为此,有一个默认的 SOLR 实用程序可用作:
Also in realm.properties you should enter your password after hashing & for this there is a default SOLR utility which can be used as:
java -cp jetty-util-8.1.10.v20130312.jar org.eclipse.jetty.util.security.Password <用户名><密码>
例如:java -cp jetty-util-8.1.10.v20130312.jar org.eclipse.jetty.util.security.Password admin 12345
输出:
<代码>12345OBF:19bv19bx19bz19c119c3MD5:827ccb0eea8a706c4c34a16891f84e7b密码:adpliAB3dA.06您可以在属性文件中使用三种形式中的任何一种及其类型:
12345
OBF:19bv19bx19bz19c119c3
MD5:827ccb0eea8a706c4c34a16891f84e7b
CRYPT:adpliAB3dA.06
You can use any of the three forms in properties file along with their type as:
管理员:MD5:827ccb0eea8a706c4c34a16891f84e7b,管理员
希望这可能会有所帮助!
Hope this might help!
这篇关于Jetty/SOLR 管理面板密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!