配置 Solr 的基本驗證 (獨立模式)
會透過在安裝時提供的使用者名稱與密碼自動配置基本驗證。本節描述如何根據需要手動配置基本驗證。
1. 使用下列指令停止 Solr︰
Windows
<INDEX_SEARCH_HOME>/bin/Index_Search_Server.bat stop
Unix
sh <INDEX_SEARCH_HOME>/bin/Index_Search_Server.sh stop
2. 在位置 <INDEX_SEARCH_HOME>/solr/server/solr 處建立 security.json 檔案。
{"authorization":{"user-role":{"solr":"admin"},"permissions":[{"role":"admin","name":"security-edit"},{"role":"admin","name":"restrict_collections"},{"role":"admin","name":"restrict_select"},{"role":"admin","name":"restrict_update"},{"role":"admin","name":"read"}],"class":"solr.RuleBasedAuthorizationPlugin"},"authentication":{"credentials":{"solr":"QYZUoPfBdxuI5uj/kUtzzq1vd8PzVly4w4Tb2ex7AFs= Pf23jNAILqwXhFr0KryubbQKgbUTVshXUf+vb6kNpgc="},"blockUnknown":true,"class":"solr.BasicAuthPlugin"}}
3. 使用下列指令啟動 Solr︰
Windows
<INDEX_SEARCH_HOME>/bin/Index_Search_Server.bat start
Unix
sh <INDEX_SEARCH_HOME>/bin/Index_Search_Server.sh start
4. 開啟 Solr 管理員介面,並確認系統是否提示您輸入使用者名稱與密碼︰
http://<SOLR_HOSTNAME>:<SOLR_PORT>/solr
變更 Solr 使用者或密碼
您變更 Solr 使用者或密碼時,必須更新 Windchill 索引搜尋用戶端與伺服器。
1. 開啟 Windchill Shell 並執行下列指令來變更 Windchill Index Search 用戶端的密碼或使用者︰
xconfmanager -s wt.index.solrAdminUser=<New_User> -t codebase/WEB-INF/conf/index.solrAuth.properties -p
xconfmanager -s wt.index.solrAdminPassword=<New_Password> -t codebase/WEB-INF/conf/index.solrAuth.properties -p
2. 重新啟動 Windchill
3. 從指令提示下,導覽至 <INDEX_SEARCH_HOME>/bin,並執行下列指令來變更 Windchill Index Search 伺服器的密碼或使用者︰
Windows:
xconfmanager -s wt.index.server.solrAdminUser=<New_User> -t config/solrserver.properties -p
xconfmanager -s wt.index.server.solrAdminPassword=<New_Password> -t config/solrserver.properties -p
Unix:
sh xconfmanager -s wt.index.server.solrAdminUser=<New_User> -t config/solrserver.properties -p
sh xconfmanager -s wt.index.server.solrAdminPassword=<New_Password> -t config/solrserver.properties -p
4. 重新啟動 Solr。
這是否有幫助?