Install Solr4.8.0 on Tomcat
Solr is a java-based web application. Therefore, JDK and tomcat must be installed before solr is installed. I will omit tomcat and jdk installation.
The first step: of course is to download to the official online download the latest solr version,: http://lucene.apache.org/solr/
Step 2: The downloaded package should look like this, solr-4.8.0.tgz, first decompress the package;
In linux, run tar-zxvf solr. tgz to decompress the package;
In a windows environment, decompress the package directly;
Installation with dummies:
Copy the solr. war package under the. solr-4.8.0 \ example \ webapps directory to webapps
Decompress solr. the format of the war package is the same as that of the zip package. You can decompress the package directly using the tool on the window, if it is on linux: use this command to decompress uzip solr. war.
Go to the solr \ WEB-INF directory after decompression and edit web. find the following node in xml and configure your solr/home directory. This directory is your solr user directory (which is called by Jianghu people ). Determine your solr user directory. The following is my directory.
<Env-entry>
<Env-entry-name> solr/home </env-entry-name>
<Env-entry-value>/user/local/solr/home </env-entry-value>
<Env-entry-type> java. lang. String </env-entry-type>
</Env-entry>
Many documents on the Internet are configured here to enable the tomcat server where solr is located. Of course, this cannot be started because the package is missing (the log package is extracted after solr4.0, not packaged to solr. war package) There are two ways to load these packages
A) Copy all packages under solr-4.8.0 \ example \ lib \ ext to the solr web-inf/lib directory
B) Directly copy these packages to $ {tomcat_home} \ lib in the tomcat container (this is recommended on the official website)
At this time, the system will still report an error because solr does not have a core. At this time, you have to copy the core instance that comes with solr to the solr user directory configured above, for example, I copied all the files under the example \ solr directory to your/user/local/solr/home directory.
Start tomcat and Use http: // localhost: 8080/solr to solve the problem.
Enterprise-level installation:
You can install the above installation in this way during the test. However, if your solr application is deployed in the production environment, you must use the tomcat virtual directory for installation, keep in mind this method and develop good habits
Copy the solr. war package under the. solr-4.8.0 \ example \ webapps directory to webapps
Decompress solr. the format of the war package is the same as that of the zip package. You can decompress the package directly using the tool on the window, if it is on linux: use this command to decompress uzip solr. war.
There are two ways to install the tomcat virtual directory. Here is a simple one!
Go to your tomcat/conf/directory, edit your server. xml file, find the host node,
Add the following code. The following code is my configuration. I have heard of expert training before. What did they do!
<Host name = "localhost" appBase = "webapps" unpackWARs = "true"
AutoDeploy = "true">
<Context path = "/solr" docBase = "/usr/solrCloud/tomcat1/display/solr. war"
Debug = "0" privileged = "true">
<Environment name = "solr/home" type = "java. lang. String"
Value = "/usr/solrCloud/nviat1/display/solr/home" override = "true"/>
</Context>
For a brief explanation, path: specifies that the name of the Web application to be accessed is the red part of http: // locahost: 8080/solr.
DocBase: Specifies the file path of the Web application. If it is a war package, a suffix must be added.
The following <Environment> node is the solr user directory.
Allow me to copy the above words for your smooth reading
Many documents on the Internet are configured here to enable the tomcat server where solr is located. Of course, this cannot be started because the package is missing (the log package is extracted after solr4.0, not packaged to solr. war package) There are two ways to load these packages
A) Copy all packages under solr-4.8.0 \ example \ lib \ ext to the solr web-inf/lib directory
B) Directly copy these packages to $ {tomcat_home} \ lib in the tomcat container (this is recommended on the official website)
At this time, the system will still report an error because solr does not have a core. At this time, you have to copy the core instance that comes with solr to the solr user directory configured above, for example, I just copied all the files under the example \ solr directory to your/usr/solrCloud/javasat1/display/solr/home directory.
If you follow my steps, start the tomcat where solr is located.
Solr3.6.1 build an environment in Tomcat6
Tomcat-based Solr3.5 cluster deployment
Load Balancing for Solr clusters using Nginx on Linux
Install and use Solr in Linux
Deploy Solr 4 on Ubuntu 12.04 LTS through Tomcat
Solr implements Low Level query parsing (QParser)
Build a search Server Based on Solr 3.5
Solr 3.5 development and application tutorial PDF
Solr 4.0 deployment instance tutorial
Solr details: click here
Solr: click here
This article permanently updates the link address: