Install Apache Solr on Ubuntu

1.  Install Tomcat on ubuntu

sudo apt-get update && apt-get upgrade

sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples

sudo apt-get install libmysql-java

2) Download apache-solr-1.4.1.tar.gz

cd /home/<user-name>/Desktop/

wget -c


sudo cp apache-solr-1.4.1/dist/apache-solr-1.4.1.war /var/lib/tomcat6/webapps/solr.war

sudo cp -R apache-solr-1.4.1/example/solr/ /var/lib/tomcat6/solr/

3) Establish new Solr configuration in Tomcat6

sudo vim /etc/tomcat6/Catalina/localhost/solr.xml

and paste the below given code

<Context docBase=”/var/lib/tomcat6/webapps/solr.war” debug=”0″ privileged=”true” allowLinking=”true” crossContext=”true”>
<Environment name=”solr/home” type=”java.lang.String” value=”/var/lib/tomcat6/solr” override=”true” />

4. Create Folder data and Change Solrconfig.xml (For single core) .  create folder in solr in /var/lib/tomcat6/solr/

mkdir data

Change path data in solr/conf/solrconfig.xml


5. And at last restart Tomcat

sudo service tomcat6 restart

6) Load  http://localhost:8080/solr/ in your browser


apache lucene features

1) Its open source
2) Can implement in any languages that are index compatible
3) Support  date ranged, ranked and fielded searching
4) Can sort it using any field
5) Need less primary memory
6) Has powerful, accurate, and efficient search algorithms
7) Support multiple-index searching with merged results
8 )  Cross-Platform Solution
9) Support simultaneous update and searching

Beginners' Guide , PHP Programmer , Zend Certified Engineer , Magento Certified Developer