Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:32:27+00:00 2026-05-28T00:32:27+00:00

I have an Apache Solr instance deployed in Glassfish and I am using this

  • 0

I have an Apache Solr instance deployed in Glassfish and I am using this Solr instance from Java code via Solrj. The thing is, that I want to restrict access to Solr so that just this Java code can access it (the code can run from different IP addresses).

My first thought was to change the web.xml of my deployed Solr instance to add Basic Authentication using a Glassfish’s file-based Realms, because I used this to restrict access to a REST interface in another project. So I’ve added the following lines into the Solr web.xml:

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Secure</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      <http-method>HEAD</http-method>
      <http-method>PUT</http-method>
      <http-method>OPTIONS</http-method>
      <http-method>TRACE</http-method>
      <http-method>DELETE</http-method>
    </web-resource-collection>
    <auth-constraint>
      <description>has to be a USER</description>
      <role-name>USERS</role-name>
    </auth-constraint>
  </security-constraint>

  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>userauth</realm-name>
  </login-config>

  <security-role>
    <role-name>USERS</role-name>
  </security-role>

But somehow this thing doesn’t work for Solr access. I don’t get the authentication dialog, which is pretty weird, because it worked in another setup.

In general, is this way of protecting a Solr instance a good approach or should I try another one? In the Solr Security page, they talking about firewalling the Solr instance. I am not a Linux admin, but I think iptables would be a possible solution and there are some nice answers on serverfault (e.g. this one).

What do you think?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:32:28+00:00Added an answer on May 28, 2026 at 12:32 am

    OK, my solution was really to use firewalling instead of modifying Solr in some way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using SolrJ, the Java client for Apache Solr server, at my
Let's say I have document indexed with Apache Solr that contains this string: Klüft
I have tried search using Apache SOLR. I have done with the PHP client
I'm using Apache Solr and querying an index with a schema that has a
Is it possible to extract search statistics from Apache SOLR (3.2)? For instance I
I am using Apache Solr for search. I use this to provide personal user-based
I have configured the QueryElevation component as here: http://wiki.apache.org/solr/QueryElevationComponent And I can see that
At the moment I have to go to /usr/java/apache-solr-1.4.0/example and then do: java -jar
I am using apache-nutch-1.4 with apache-solr-3.2.0 I have successfully integrated NUTCH with SOLR when
I have this error while using DiH for importing data from SQL Server to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.