Install Apache Solr on CentOS 6


mantle-solrSolr is the popular, blazing fast open source enterprise search platform from the Apache LuceneTM project. Its major features include powerful full-text search, hit highlighting, faceted search, near real-time indexing, dynamic clustering, database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world’s largest internet sites.

This article shows how to install solr in a Linux production environment.

  1. Install Tomcat6 and its dependencies:[bash]yum install tomcat6[/bash]
  2. Install  Tomcat6-admin: [bash]yum install tomcat6[/bash]
  3. Edit /etc/tomcat6/tomcat-users.xml to add a new tomcat admin/manager
  4. Download solr package (http://lucene.apache.org/solr/downloads.html), and get solr project to anywhere (e.g.: we put solr projects at /home/solr/public)
  5. Create a new xml file at /etc/tomcat6/Catalina/localhost/ to put solr configuration, for example:[xml]<?xml version="1.0" encoding="utf-8"?>
    <Context docBase="/home/solr/public/webapps/solr.war" debug="1" crossContext="true">
    <Environment name="solr/home" type="java.lang.String" value="/home/solr/public/solr" override="true"/>
    </Context>[/xml]
  6. Restart tomcat:[bash]service tomcat6 restart[/bash]

About NhocConan

A super lazy guy who tries to write tech blog entries in English.He is lazy, so he can only write when he is in a good mood or when he is tired of coding.

Leave a comment

Your email address will not be published. Required fields are marked *