Changeset 32430 for gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/SolrSearch.java
- Timestamp:
- 2018-09-06T22:34:17+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/SolrSearch.java
r32419 r32430 46 46 Properties globalProperties = new Properties(); 47 47 globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties")); 48 49 /* 48 50 String host = globalProperties.getProperty("tomcat.server", "localhost"); 49 51 //String port = globalProperties.getProperty("tomcat.port.http", "8383"); … … 56 58 String portStr = port.equals("80") ? "" : ":"+port; 57 59 solr_servlet_base_url = protocol+"://"+host+portStr+"/"+solrContext; 60 */ 61 62 // The solr servlet is only accessible locally (from "localhost", specifically 127.0.0.1). 63 // for security reasons, as we don't want non librarian users 64 // to go to the solr servlet and delete solr cores or something. 65 // The security Valve element in the tomcat solr.xml context file restricts 66 // access to 127.0.0.1, but here we ensure that the solr URL is the local http one 67 // and not any https with domain name and https port. 68 // Note that we use 127.0.0.1 instead of literally "localhost" since localhost is unsafe 69 ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties); // can throw an Exception 70 String solrContext = globalProperties.getProperty("solr.context", "solr"); 71 solr_servlet_base_url = protocolPortProps.getLocalHttpBaseAddress()+"/"+solrContext; 58 72 } catch(Exception e) { 59 73 logger.error("Error reading greenstone's tomcat solr server properties from global.properties", e);
Note:
See TracChangeset
for help on using the changeset viewer.