{"id":418,"date":"2012-04-26T23:25:09","date_gmt":"2012-04-26T22:25:09","guid":{"rendered":"http:\/\/daniel.hepper.net\/blog\/?p=418"},"modified":"2012-04-26T23:31:13","modified_gmt":"2012-04-26T22:31:13","slug":"restricting-ip-addresses-for-solr-with-jetty","status":"publish","type":"post","link":"https:\/\/daniel.hepper.net\/blog\/2012\/04\/restricting-ip-addresses-for-solr-with-jetty\/","title":{"rendered":"Restricting Solr with Jetty to localhost"},"content":{"rendered":"<p>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 <code>java -jar start.jar<\/code> and you can start searching like a pro.<\/p>\n<p>However, the integrated Jetty server is configured to bind to port 8983 on all IP adresses by default. This configuration is unsafe: anyone could <a href=\"http:\/\/daniel.hepper.net\/blog\/2010\/11\/howto-clear-solr-index\/\" title=\"Howto clear Solr index\">clear your whole Solr index<\/a>!<\/p>\n<p>It is a good idea to let the server listen only on localhost, unless your server is in a private network. A quick solution is to set the system properties <code>jetty.host<\/code> and <code>jetty.port<\/code> on startup, e.g. like that:<\/p>\n<p><code>java -Djetty.host=127.0.0.1 -Djetty.port=1337 -jar start.jar<\/code><\/p>\n<p>Alternatively, you can edit the configuration at <code>example\/etc\/jetty.xml<\/code>. Look for these lines:<\/p>\n<p><code>&lt;Set name=\"host\"&gt;&lt;SystemProperty name=\"jetty.host\" \/&gt;&lt;\/Set&gt;\u00ac<br \/>\n&lt;Set name=\"port\"&gt;&lt;SystemProperty name=\"jetty.port\" default=\"8983\"\/&gt;&lt;\/Set&gt;<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/daniel.hepper.net\/blog\/2012\/04\/restricting-ip-addresses-for-solr-with-jetty\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-418","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/comments?post=418"}],"version-history":[{"count":7,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/418\/revisions"}],"predecessor-version":[{"id":429,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/418\/revisions\/429"}],"wp:attachment":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/media?parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/categories?post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/tags?post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}