1. Decompress SOLR
[[Email protected] TMP] Tar-zxvf solr-4.7.0.tgz
2. Move the SOLR package to the OPT directory:
[[Email protected] TMP] Music/tmp/solr-4.7.0/opt/SOLR
3. Copy SOLR. War in exmaple/webapps to Tomcat
[[Email protected] TMP] makdir-P/opt/tomcat/webapps
[[Email protected] TMP] CP/opt/SOLR/example/webapps/SOLR. War/opt/tomcat/webapps/
[[Email protected] TMP] Vim/usr/local/tomcat/CONF/server. xml
<Host name = "localhost" appbase = "/opt/tomcat/webapps"
Unpackwars = "true" autodeploy = "true">
Change webapps to/opt/tomcat/webapps;
4. Start tomcat, automatically decompress SOLR. War, and modify web. xml under the SOLR project.
[[Email protected] TMP] cd/usr/local/tomcat/bin/
[[Email protected] bin]./startup. Sh
[[Email protected] bin] vi/opt/tomcat/webapps/SOLR/WEB-INF/Web. xml
5. Modify the SOLR home configuration (Note: You need to remove the comments of this Section, otherwise it will not take effect ):
<Env-entry>
<Env-entry-Name> SOLR/home </env-entry-Name>
<Env-entry-value>/opt/SOLR/example/SOLR </env-entry-value>
<Env-entry-type> JAVA. Lang. String </env-entry-type>
</Env-entry>
6. Copy the jar package under SOLR/example/lib/EXT to/tomcat/../SOLR/WEB-INF/lib:
[[Email protected] TMP] CP/opt/SOLR/example/lib/EXT/*. Jar/opt/tomcat/webapps/SOLR/WEB-INF/lib/
7. Create classpath under Tomcat SOLR and copy example/resources/log4j. properties to classpath:
[[Email protected] TMP] mkdir-P/opt/tomcat/webapps/SOLR/classpath
[[Email protected] TMP] CP/opt/SOLR/example/resources/log4j. properties/opt/tomcat/webapps/SOLR/classpath/
8. Restart tomcat after configuration is complete.
/Usr/local/tomcat/bin/shutdown. Sh
/Usr/local/tomcat/bin/startup. Sh
9. Enter http: // 192.168.1.196: 8080/SOLR/in the browser to go to The SOLR admin screen.
This article is from the blog "someone says my technology house", please be sure to keep this source http://1992mrwang.blog.51cto.com/3265935/1543694
Tomcat + SOLR