Have seen a lot of installed blog posts, combined with several plans to write their own simple integrated step, first ensure that the installation of JDK and Tomcat
1. Download solr-4.10.4, unzip to/opt
2. Select a directory for SOLR and use the SOLR_HOME environment variable to point to this directory, I chose/OPT/SOLR here, so my solr_home=/opt/solr. If you want to choose a different directory please replace/OPT/SOLR
3. Copy/opt/solr-4.10.4/example/solr/* to/OPT/SOLR
4. Copy/opt/solr-4.10.4/example/webapps/solr.war to/OPT/SOLR
5. Edit the DataDir configuration item in/opt/solr/collection1/conf/solrconfig.xml
<
dataDir
>${solr.data.dir:/opt/solr/data}</
dataDir
>
6. Create a Data Catalog for SOLR, Mkdir/opt/solr/data
7. To set up a new context (Web application) in Tomcat and point to our SOLR file, simply create the file /etc/tomcat/conf/localhost/solr.xml , which reads as follows:
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
Context
docBase
=
"/opt/solr/solr.war"
debug
=
"0"
crossContext
=
"true"
>
<
Environment
name
=
"solr/home"
type
=
"java.lang.String"
value
=
"/opt/solr"
override
=
"true"
/>
</
Context
>
8. Modify the tomcat/webapp/solr/web-inf/web.xml file as follows:
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/opt/solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
9. Copy all jar packages under the /opt/solr-4.10.4/example/lib/ext directory to the /opt/tomcat/webapp/solr/web-inflib directory.
10. Copy /opt/solr-4.10.4/example/example-dih/solr/db/conf/currency.xml to solr/collection1/ conf/under
ubuntu14.04 under TOMCAT7 deployment solr-4.10.4