basic http authentication Solr 5.X?

step 1 : setting solr listen in localhost

edit jetty-http.xml in server/etc/jetty-http.xml

add
 default="localhost"
after like this

<Set name="host"><Property name="jetty.host" default="localhost"/></Set> 
restart your solr

step 2 :  install nginx, create file /etc/nginx/conf.d/solr.conf that looks like this:

server
{
  #This is the external port
  listen 8000;

  # Disable proxy buffering because it was causing problems
  proxy_buffering off;

  # All other urls expect admin permission
  location / {
    # Make sure to add new users to htpasswd!
    auth_basic "Private";
    auth_basic_user_file /etc/nginx/htpasswd;
    proxy_pass http://localhost:8983;
  }
} 
 
step 3. install httpd-tools yum install httpd-tools Create the user/passwd like this: 
sudo htpasswd -c /etc/nginx/htpasswd yourusernamehere
or you can use tools generator 
 
step 4. restart nginx and open http://YOURIP:8000  
If you enter it correctly, you should see the Solr admin panel VIOLLA!

Comments

Popular Posts