Beginners, if there is anything wrong, please advise.
SOLR is generally used under Linux, but for beginners, there are some problems with Linux. So, let's practice practiced hand in Windows first. SOLR is written in Java, so it can be run either on Linux or in Windows. The configuration process is similar, you can refer to each other.
Required Documents and Environment:
JDK 1.7+, and configure environment variables
Tomcat
Solr
1. Download the SOLR website
Enter http://apache.fayea.com/lucene/solr/website address http://www.apache.org/dyn/closer.lua/lucene/solr/
2. Create the SOLR root directory
Create a folder on disk. It is best not to have Chinese in order to avoid mistakes. I am here to create the Solr folder in the C-packing directory.
3. Copy Tomcat to the SOLR root directory
4. Unzip the downloaded solr-4.10.3.tgz and get the following directory
5. Go to Dist folder, copy Solr-4.10.3.war to Tomcat/webapps, unzip, rename to Solr. This step is to deploy SOLR on Tomcat. Then delete the war package
6. Copy the 5 jar packages Solr-4.10.3.tgz\solr-4.10.3\example\lib\ext inside the solr-4.10.3 file package to C:\solr\apache-tomcat-7.0.68\ Under the Webapps\solr\web-inf\lib. This step is to copy the jar package that SOLR relies on to Web-inf\lib.
7. Create a solrhome. This step is critical and error prone.
There is a SOLR folder under the Solr-4.10.3.tgz\solr-4.10.3\example directory. Note that this is not the SOLR folder that we created in the C packing directory. Now I'm talking about the folder inside the folder you downloaded.
This folder is then copied to C:\SOLR, renamed to Solrhome, and now has Tomcat's newly copied solrhome in the SOLR directory. We open solrhome to see what's inside. This Collection1 folder is where the configuration file is stored. This folder is important.
8. Modify the configuration file. Configure Solrhome
Open C:\solr\apache-tomcat-7.0.68\webapps\solr\WEB-INF\web.xml File
In 40 rows or so, modify <env-entry-value> for your Solrhome directory. and remove the comment from this paragraph. Because the default is commented out, if not removed, it is equivalent to not configured.
9. This concludes. The configuration is complete. Use CMD to enter Tomcat's Bin directory, Startup.bat. Tomcat started successfully. But notice that there is a log4j warning. This is because we do not have a log4j.properties file, which can be configured or ignored. The workaround is described later.
10. Visit LOCALHOST:8088/SOLR I changed the port number to 8088, if not modified is the default 8080.
See the following page. If the access has a 500 error, saying that the configuration file could not be found is the 7th step error.
11. Resolve the log4j warning. This step can be ignored. There is a log4j.properties file under Solr-4.10.3.tgz\solr-4.10.3\example\resources. Copy it to Tomcat under the Webapps\solr\web-inf\classes directory. Create it yourself without the directory.
Finally, the page information is introduced. The pictures come from the network.
Build SOLR server under Windows to consolidate Tomcat