I'm trying to get this to work using HTTP authentication with a multi-core solr server on a different machine. The apachesolr module with the identical settings can reach the solr server okay but the search api solr module keeps saying The Solr server could not be reached.
My settings look like this:
Service options
Solr server URI
http://192.168.168.80:8080/solr/www.idee-europe.org
Basic HTTP authentication
Username: www.idee-europe.org
Password: ********
Looking at my jetty log there aren't any entries. I added one dsm to the module and it gives me this before doing the ping:
... (Object) SearchApiServer
id (String, 1 characters ) 3
name (String, 9 characters ) Resources
machine_name (String, 9 characters ) resources
description (String, 0 characters )
class (String, 23 characters ) search_api_solr_service
options (Array, 5 elements)
http_user (String, 19 characters ) www.idee-europe.org
http_pass (String, 8 characters ) ********
host (String, 14 characters ) 192.168.168.80
port (String, 4 characters ) 8080
path (String, 25 characters ) /solr/www.idee-europe.org
enabled (String, 1 characters ) 1
module (NULL)
status (String, 1 characters ) 0
Any help very much appreciated.
Comments
Comment #1
miiimoooI spent a bit of time and found out that the problem is caused by my php settings. The PHP function file_get_contents (in search_api_solr/solr_connection.inc, ~ line 58) doesn't work with allow_url_fopen turned off (for security reasons).
Enabling the setting fixed the problem. But can I also suggest to use something else (maybe the same function the apachesolr module uses) just for the reason I'm paranoid and like turning allow_url_fopen off.
Comment #2
drunken monkeyThat's weird. As far as I know, I do use the same method as the apachesolr module for communicating with Solr, i.e., the SolrPhpClient library. Which, sadly, is pretty bad, but still the best one there seems to be at the moment (although I do know that Robert and the other guys from the apachesolr module are currently planning to change this).
But I see now that they indeed overrode the way the Solr server is connected, using
drupal_http_request()(which I hadn't even heard of until now) instead.Switching to another Solr library is planned anyways (as soon as it becomes available), then this will be fixed as well. But I see that this enabling
allow_url_fopenis indeed a security risk I myself wouldn't allow unless necessary, so I'll try to fix this soon. Shouldn't take too long, even though the library is (as said) pretty poorly written and doesn't make this particularly easy …Comment #3
drunken monkeyShould be fixed now. (Hooray for
theftOpen Source! ;))