Restricting Solr with Jetty to localhost

November 11th, 2014 | by admin |

If you want to try Apache Solr, the easiest way to get started is to use the example the comes with the download. Just run java -jar start.jar and you can start searching like a pro.

However, the integrated Jetty server is configured to bind to port 8983 on all IP adresses by default. This configuration is unsafe: anyone could clear your whole Solr index!

It is a good idea to let the server listen (bind) only on localhost, unless your server is in a private network. A quick solution is to set the system properties jetty.host and jetty.port on startup, e.g. like that:

Alternatively, you can edit the configuration at example/etc/jetty.xml. Look for these lines:

Post a Comment

*