In the last post, i covered how to troubleshoot Xampp port error for configuring Tomcat Apche Server on Windows. In this post i would be covering on How to install Solr on Windows.

Solr is an open source enterprise search platform from the Apache Lucene project written in Java. Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, and rich document (e.g., Word, PDF) handling. Providing distributed search and index replication, Solr is highly scalable. Solr runs as a standalone full-text search server within a servlet container such as Apache Tomcat. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language. (Wiki)

Steps to install Solr on windows:

1. If you have successfully installed Tomcat Server (using Xampp probably), try opening localhost:8080. If this shows a page with message “If you’re seeing this page via a web browser, it means you’ve setup Tomcat successfully. Congratulations!” , you are good to go to second step. We assume tomcat has been installed under D:\xampp\tomcat

2. Download and unzip the Solr distribution zip file into a temp folder at D:\temp\solrZip\
Latest build (As of Apr 16, 2012) can be downloaded from here :

3. Create a directory as “solr home” directory called, where you intend the application server to function, You may create it inside xampp installation directory itself at

4. Copy the contents of the example\solr directory D:\temp\solrZip\example\solr\ to D:\xampp\solr\

5. Stop the Tomcat service

6. Copy the *solr*.war file from D:\temp\solrZip\dist\ to the Tomcat webapps directory D:\xampp\tomcat\webapps\ and rename the *solr*.war file solr.war

7. Configure Tomcat to recognize the solr home directory you created, by adding the Java Options -Dsolr.solr.home=D:\xampp\solr\ and -Dsolr.velocity.enabled=false
either use the system tray icon to add the java option
or manually edit the environment script D:\xampp\tomcat\bin\setenv.bat and add it to JAVA_OPTS

* Note: For Tomcat 7 and Solr3.6, the above option on setenv.bat may not work, so you could not use it and put this code fragment
on $CATALINA_HOME/conf/Catalina/localhost/solr.xml

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="D:\xampp\tomcat\webapps\solr.war" debug="0" crossContext="true" >
<Environment name="solr/home" type="java.lang.String" value="D:\xampp\solr\" override="true" />

8. Start the Tomcat service

9. Go to the solr admin page to verify that the installation is working. It will be at http://localhost:8080/solr/admin

You are good to go with Solr over Tomcat now.. .


7 thoughts on “Installing Solr over Windows”

  1. Please elaborate on step 7. I have no idea how to edit the java option and there is no D:\xampp\tomcat\bin\setenv.bat file.

Leave a Reply

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