Hi,

I've properly installed Solr 3.5.0 on Tomcat 7 in a CentOS 6 distribution, configuring Solr to run with a single core (standard method).
I've installed Drupal 7.12 and the module Apache Solr Search Integration (7.x-1.0-beta16), replacing the files schema.xml, solrconfig.xml and protwords.txt in the conf Solr directory with those that come with the module.

So, I've acces to:

http://localhost:8080/solr/

and to:

http://localhost:8080/solr/admin/

with no errors. All works fine.

But when I try to configure the settings in the Drupal site (admin/config/search/apachesolr/settings/solr/edit), from the same computer and browser, I can't connect with the Solr server (the error message is "Your site was unable to contact the Apache Solr server.").

In the filed "Solr server URL" I've tried with:

http://localhost:8080/solr/
http://localhost:8080/solr
http://localhost:8080/solr/admin
http://localhost:8080/solr/admin/

but I obtain the same error message with all of them.

Just in case..., installing Tomcat 7 I had changed the iptables:

[root@15900696 ~]# /sbin/iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
[root@15900696 ~]# /sbin/iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
[root@15900696 ~]# iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
[root@15900696 ~]# iptables -t nat -A PREROUTING -p udp -m udp --dport 80 -j REDIRECT --to-ports 8080
[root@15900696 ~]# /sbin/service iptables save
[root@15900696 ~]# service iptables restart

I've had the same problem with a Solr multicore installation (http://drupal.org/node/1445836).

Please, any idea?

Thanks!!

CommentFileSizeAuthor
#4 phpinfo.pdf108.99 KBecalcerrada

Comments

nick_vh’s picture

Status: Active » Postponed (maintainer needs more info)

Can you do me a favor and try to do the setup with Jetty first? So at least you can exclude the tomcat part as being the problem?
You can follow this guide to get it up and running

http://nickveenhof.be/blog/simple-guide-install-apache-solr-3x-drupal-7

ecalcerrada’s picture

Hi Nick_vk, thanks for your answer,

Ok, I've tried with Jetty and I've have got the same problem:

I can access Solr at

http://localhost:8983/solr/

and at

http://localhost:8983/solr/admin/

from my browser, but when I try to configure Drupal I get always the same error. In the filed "Solr server URL" this time I've tried with:

http://localhost:8983/solr/
http://localhost:8983/solr
http://localhost:8983/solr/admin
http://localhost:8983/solr/admin/

but when I click on "Test connection" button I always get the same error message:

"Your site was unable to contact the Apache Solr server."

nick_vh’s picture

I still think you have file permission problems? Maybe you do not allow your php user to make external connections? This is not a drupal problem. Please report back whenever you figured out what the problem was for future references

ecalcerrada’s picture

StatusFileSize
new108.99 KB

Yes Nick, I think you're right, It seems a problem of permissions. I know this is not a Drupal problem, but, please, may you tell me how should I allow my php user to make external connections? I've searched on Google but I don't find nothing precise... I don't know if I have to change some php directive or change the properties of the php user in CentOS...

I send you my phpinfo in a PDF attachment..., maybe it can help...

Thank you very much!

nick_vh’s picture

Try to disable your iptables completely. I don't have the time at the moment nor the insight to help you by watching at a phpinfo. Hopefully someone would be able to help you. Let's hope! :-)

ecalcerrada’s picture

OK, Thanks anyway.

ecalcerrada’s picture

Ok, I've finally found the solution here (http://drupal.org/node/410896#comment-4113768).

The problem was SELinux preventing the http daemon from connecting to itself or the relay ports. SELinux denied the http daemon from connecting to itself or the relay ports. To allow httpd to connect to httpd/ftp ports you need to turn on the httpd_can_network_relay boolean:

# setsebool -P httpd_can_network_relay=1

nick_vh’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
sjhuskey’s picture

You can receive this error if you are using http basic authorization to limit access to Solr. In that case, set the Server URL to include the username and password, using the following pattern: http://username:password@example.com:8080/solr. So, if your username is user, your password is 12345, your URL is mysite.com, and your Solr is using port 8080, do http://user:12345@mysite.com:8080/solr.