The whole process of installing solr4.8.0 on tomcat

Please reprint from the source: http://eksliang.iteye.com/blog/2096478

      First of all, solr is a java-based web application, so JDK and tomcat must be installed before installing solr. I will omit the installation of tomcat and jdk here.

       

The first step: of course, go to the official website to download the latest solr version, download address: http://lucene.apache.org/solr/

 

            

        Step 2: The downloaded package should look like this, solr-4.8.0.tgz, first decompress the package;

                   If it is on linux: tar -zxvf solr.tgz decompress with this command;

                   If it is a windows environment, just decompress it directly;

                      

        Dummy installation:

             Copy the solr.war package in the .solr-4.8.0\example\webapps directory to the webapps

       Unzip the solr.war package. The format of the war package is the same as the zip format. If you use the tool to decompress it directly on the window, you can unzip it. If it is on linux: use this command to unzip uzip solr.war.

    Enter the decompressed solr\WEB-INF directory, edit web.xml to find the following node, configure your solr/home directory, this directory is your solr user directory (anyway, people in the world call this directory so). Determine the user directory of your solr yourself, 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 distributed here, and you are asked to start the tomcat server where solr is located. Of course, it will not start at this time, because the package is missing (the log package is extracted after solr 4.0, and it is not packaged into the solr.war package) here are Load these packages in two ways

   a) Copy all packages under solr-4.8.0\example\lib\ext to solr's web-inf/lib directory 

   b) Copy these packages directly to ${tomcat_home}\lib in the tomcat container (the official website recommends doing this)

   

   At this point, the startup will still report an error, because the solr does not have core at this time. At this time, you have to copy the core instance that comes with solr to your configuration, the solr user directory, for example, I did this to the example\solr directory. Copy all files to your /user/local/solr/home directory

  Start tomcat, there is definitely no problem with http://localhost:8080/solr, and there is no problem with years of practice.

   

   Enterprise level installation:

  You can install the above installation in this way during testing, but if your solr application is deployed in the production environment, how to do it, of course, you have to use the virtual directory of tomcat to install, remember this method, and develop a good habit

   

      Copy the solr.war package in the .solr-4.8.0\example\webapps directory to the webapps

       Unzip the solr.war package. The format of the war package is the same as the zip format. If you use the tool to decompress it directly on the window, you can unzip it. If it is on linux: use this command to unzip uzip solr.war.

       There are two ways to install the virtual directory of tomcat. I will introduce the simple one here!

      Enter 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 Taobao's expert training before, and that's how they do it!

   

 

<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/tomcat1/display/solr/home" override="true"/>
	</Context>

 
        To explain briefly, path: specifies the name of the web application to access: http://locahost:8080/ The red part of solr

 

                         docBase: specifies the file path of the web application; if it is a war package, it must be suffixed

                         The following <Environment> node is the user directory where solr is set

 For your smooth reading, allow me to copy the original words above

    Many documents on the Internet are distributed here, and you are asked to start the tomcat server where solr is located. Of course, it will not start at this time, because the package is missing (the log package is extracted after solr 4.0, and it is not packaged into the solr.war package) here are Load these packages in two ways

   a) Copy all packages under solr-4.8.0\example\lib\ext to solr's web-inf/lib directory 

   b) Copy these packages directly to ${tomcat_home}\lib in the tomcat container (the official website recommends doing this)

   

   At this point, the startup will still report an error, because the solr does not have core at this time. At this time, you have to copy the core instance that comes with solr to your configuration, the solr user directory, for example, I did this to the example\solr directory. Copy all files to your /usr/solrCloud/tomcat1/display/solr/home directory

   If you follow my steps to get it, there is no problem with starting the tomcat where solr is located at this time.

    

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326536205&siteId=291194637