Search code examples
solrsolrcloud

How can i change my localhost domain in Apache solr? (linux OS)


i want to change domain..(linux)

For now the url to access solr is in the localhost domain: http://localhost:8983/solr I'd like to change it to another domain, but I don't know how to do it. http://www.exmple.com:8983/solr


Solution

  • Exposing Solr directly on the internet usually isn't a good idea, but if you're sure you've done the required security configuration, you can configure the listening ip in solr.in.sh.

    You can read about this and multiple other recommendation in "Taking Solr to Production":

    Use the SOLR_HOST variable in the include file to set the hostname of the Solr server.

    SOLR_HOST=solr1.example.com

    You might also have to configured -Djetty.host=<ip to bind to> when starting Solr (SOLR_OPTS in solr.in.sh or as an argument to bin/solr).

    Otherwise I recommend placing a reverse proxy in front of Solr (for example nginx) configured with IP range limitations and a heavily restricted firewall, together with authentication configured in security.json.