java -jar start.jarFire the url http://localhost:8983/solr/admin/, and you will see a Solr interface ready to be used! Add digest authentication to the admin interface At this stage, the admin interface is accessible by anyone because there is no login required. We want to add login to it. When you start Solr server the first time, it will extract Jetty server files under solr/work, you can see it from the first three lines of output after starting the server:
2009-05-13 09:27:40.260::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2009-05-13 09:27:40.680::INFO: jetty-6.1.3 2009-05-13 09:27:40.810::INFO: Extract jar:file:/path/to/solr/example/webapps/solr.war!/ to /path/to/solr/example/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webappWe want to modify the Jetty config files to enable the authentication. Change to /path/to/solr/example/work/Jetty_0_0_0_0_8983_solr.war!__solr!__k1kf17/webapp/WEB-INF directory and you will see a file called web.xml. Open this file up using you favourite editor and move to the end of file. Add the following code just before closing tag:
Solr Admin /* admin user moderator DIGEST SolrRealmThis defines three possible roles can be used: admin, user and moderator, as well as using DIGEST auth method and realm-name of the auth. This realm-name corresponses to the main configuration of Jetty server defined in /path/to/solr/examples//etc/jetty.xml file:
SolrRealm /etc/realm.propertiesThe username and password is set in /path/to/solr/examples/etc/realm.properties file, to create it:
htdigest -c realm.properties "SolrRealm" testThe second parameter “SolrRealm” need to match the one defined in jetty.xml file as mentioned before:
SolrRealmFollow the prompt to enter password twice then a new entry in the realm.properties will be created as follows:
test:SolrRealm:ddab10a18fd464a50ad1073a6b77e39fOpen it up and update it to:
test: MD5:ddab10a18fd464a50ad1073a6b77e39f,adminThe last word “admin” is the role defined in the web.xml file in the above section, you can change to user or moderator for this instant setup. Finally, restart the Jetty server by pressing Ctrl+C in the shell and re-run the command we used before to start it up:
java -jar start.jarBe sure to be at the solr root directory to run this command. Now if you refresh your browser which opened Solr admin interface before, you will be prompted to enter the username and password, enter “test” for username and whatever password you entered before and you are in.
Ay idea how to configure slave to replicate properly with Digest authentication?
on Solr WIKI I could find only basic authentication example:
http://wiki.apache.org/solr/SolrSecurity
solrconfig.xml (slave config):
username
password
I think only basic auth is supported at the moment.