Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On the apache sor config page (admin/config/search/apachesolr) i get this Error:
"401" Status: Unauthorized: UnauthorizedApache Tomcat/6.0.24 - Error report
HTTP Status 401 -
type Status report
message
description This request requires HTTP authentication ().
Apache Tomcat/6.0.24
But apache solr says that it could connect to the server without any problems.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1780200-5.patch | 557 bytes | pwolanin |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedComment #2
cpliakas CreditAttribution: cpliakas commentedIt appears that Tomcat needs HTTP authentication based on how it is configured. To me this seems like more of a Tomcat configuration question, but it also might be helpful to have a recipe for HTTP authentication with Apache Solr Search Integration Integration as well.
If you absolutely must have HTTP Authentication, you will have to set the "Authorization" header in the web request. This can be done by extending the DrupalApacheSolrService class and overriding the _makeServletRequest() method to add your header. You will then have to change the service class to your custom one either by setting the "apachesolr_service_class" variable to effect all environments or the "service_class" environment variable.
Just to spell it out further, your class could probably be something as simple as below. Note that I haven't validated the approach so it may need some work.
Then you can set either the system variable or Apache Solr environment variable via drush.
Some related topics are posted below:
One additional thought, it might make sense to make this an option that can be configured through the GUI, similar to how Search API does it. There are a lot of steps required to do this, unless I am missing something obvious.
Hope this helps,
Chris
Comment #3
Thili360 CreditAttribution: Thili360 commentedIt worked for me too by setting the Server URL to http://username:password@example.com:9080/solr
Comment #4
cpliakas CreditAttribution: cpliakas commentedThili360,
Haha. Cool! Much simpler.
Thanks for posting back,
Chris
Comment #5
pwolanin CreditAttribution: pwolanin commentedIf that's not in the docs, we should add it . I don't see anything here http://drupal.org/node/343467 nor in the README
Comment #6
pwolanin CreditAttribution: pwolanin commentedComment #7
pwolanin CreditAttribution: pwolanin commentedcommitted