Klar, ist eben fertig geworden, der Link oben sagt alles wichtige.
Zuerst muss eine Rolle( role-solr-admin ) und ein Benutzer (solr-admin) in der Datei
/etc/tomcat6/tomcat-users.xml angelegt werden:
Code: Alles auswählen
root@imap-server:/etc# git diff tomcat6/tomcat-users.xml
diff --git a/tomcat6/tomcat-users.xml b/tomcat6/tomcat-users.xml
index afa5a31..b329628 100644
--- a/tomcat6/tomcat-users.xml
+++ b/tomcat6/tomcat-users.xml
@@ -36,4 +36,7 @@
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
+<!-- solr admin Absicherung-->
+ <role rolename="role-solr-admin"/>
+ <user name="solr-admin" password="solr-admin-super-secret-password" roles="role-solr-admin"/>
</tomcat-users>
Nachdem die Rolle und der Benutzer nun definiert sind, kann man in der
/etc/solr/web.xml am Ende vor dem schließenden </web-app> der Anwendung mitteilen, dass der URL-Teil „/admin/*“ zu schützen ist:
Code: Alles auswählen
root@imap-server:/etc# git diff solr/web.xml
diff --git a/solr/web.xml b/solr/web.xml
index b709bda..3247f2b 100644
--- a/solr/web.xml
+++ b/solr/web.xml
@@ -150,4 +150,25 @@
<welcome-file>index.html</welcome-file>
</welcome-file-list>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>
+ Solr authenticated application
+ </web-resource-name>
+ <url-pattern>/admin/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>role-solr-admin</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>Basic Authentication</realm-name>
+ </login-config>
+ <security-role>
+ <description>Admin role</description>
+ <role-name>role-solr-admin</role-name>
+ </security-role>
</web-app>
Das ist der gleiche Code wie unter
https://forge.typo3.org/projects/extens ... r-Security beschrieben, nur habe ich
<url-pattern>/*</url-pattern> durch <url-pattern>/
admin/*</url-pattern> ergänzt.