Install tomcat:
The code is as follows: |
Copy code |
Apt-get update Apt-get install tomcat6 tomcat6-admin |
Download and install apachesolr:
The code is as follows: |
Copy code |
Wget http://mirrors.cnnic.cn/apache/lucene/solr/4.7.2/solr-4.7.2.tgz Tar-vxf solr-4.7.2.tgz Mkdir/opt/solr Solr-4.4.0/example/solr/*/opt/solr/ Cp solr-4.4.0/example/webapps/solr. war/opt/solr/ Cp-r solr-4.4.0/example/lib/ext/*/var/lib/tomcat6/shared/ |
Edit the apachesolr configuration file:
The code is as follows: |
Copy code |
Vi/opt/solr/collection1/conf/solrconfig. xml |
The "dataDir" parameter uses the following values:
<DataDir >$ {solr. data. dir:/opt/solr/data} </dataDir>
Change folder permissions:
The code is as follows: |
Copy code |
Mkdir/opt/solr/data Chown tomcat6/opt/solr/data/ Chmod 777/opt/solor/data/ |
---- Apachesolr server configuration ends now ----------
Download and install Drupal's search api module and search api solr module. The process is not described in detail.
Copy the configuration file about apachesolr that comes with the search api solr module to the following path: (it is best to back up the file before copying)
The code is as follows: |
Copy code |
Cp solr-conf/4.x/ */opt/solr/collection1/conf/ |
If you are prompted to overwrite the data, overwrite all data.
Restart the tomcat service:
The code is as follows: |
Copy code |
Service tomcat6 restart |
So far, the apachesolr server configuration is complete.
If you are not a ubuntu system, you can also find clues from the above configuration process.
Next time, let's take a short look at how to configure the search api solr module so that the website can use the apachesolr engine to search for your website content.