Download SOLR, tomcat, and ant from the Apache website. After SOLR is compiled with ant, * SOLR *. War is generated in the DIST directory of SOLR. You can copy the war to Tomcat webapp. You can also specify the location of the war and SOLR/home by using JNDI. Because SOLR will follow $ cmd (the directory where Tomcat is running) and SOLR/home to find the configuration file required by SOLR (schema. XML solrconfig. XML) and the storage of the last index are based on SOLR/home.
The SOLR/home method specified by JNDI is to create a SOLR. xml file under the Apache Software Foundation/tomcat 6.0/CONF/Catalina/localhost directory. The content is:
<Context docbase = "D:/temp/jaagle/apache-solr-1.3.0/Dist/SOLR. War" DEBUG = "0" crosscontext = "true">
<Environment name = "SOLR/home" type = "Java. Lang. String" value = "D:/temp/jaagle/SOLR" override = "true"/>
</Context>
Or you can directly specify the SOLR home path in Web. xml.
<Env-entry>
<Env-entry-Name> SOLR/home </env-entry-Name>
<Env-entry-value>/Put/Your/SOLR/home/here </env-entry-value>
<Env-entry-type> JAVA. Lang. String </env-entry-type>
</Env-entry>
We can clearly see the location of the war and the location of the configuration file. The SOLR configuration file is under example/SOLR, and copy the content under this directory to the specified directory.
Another way to specify SOLR/home is to add-dsolr. SOLR. Home = D:/temp/jaagle/SOLR to the parameter before starting tomcat. This is a static deployment method. You can dynamically load war files and enter the Tomcat Management page through http: // localhost: 8080/manager/html. However, the webapp loaded through the Management page will not be automatically mixed during the next Tomcat startup.
For our developers, it is best to debug SOLR code in eclipse. This problem can be solved by downloading eclipse Tomcat plugin. Currently, many plug-ins are used for sysdeo. You can download them at http://www.eclipsetotale.com/atatplugin.html. Decompress the package and add it to the plugin of Eclipse/plugins. After startup, you can see that this button is added to the toolbar. The kittens start, stop, and restart Tomcat from left to right.
Be sure to select JRE in JDK, otherwise sysde will not run!
Select Server. XML in context declaration mode
Http://wiki.apache.org/solr/SolrTomcat
Http: // localhost: 8080/manager/html/reload? Path =/SOLR
Http://www-128.ibm.com/developerworks/cn/opensource/os-ectom/