Prerequisites for Solr
Before we get ready for the installation, you need to learn about the components necessary to run Apache Solr successfully and download the following prerequisites:
- XAMPP for Windows (for example, V3.1.0 Beta 4): This can be downloaded from http://www.apachefriends.org/en/xampp-windows.html
XAMPP comes with a package of components, which includes Apache (a web server), MySQL (a database server), PHP, PhpMyAdmin, FileZilla (an FTP server), Tomcat (a web server to run Solr), Strawberry Perl, and a XAMPP control panel
- Tomcat add-on: This can be downloaded from http://tomcat.apache.org/download-60.cgi
- Java JDK: This can be downloaded from http://java.sun.com/javase/downloads/index.jsp
- Apache Solr: This can be downloaded from http://apache.tradebit.com/pub/lucene/solr/4.6.1/
- Solr PHP client: This can be downloaded from http://code.google.com/p/solr-php-client/
Tip
It is recommended that you choose the latest version of the preceding components due to the fact that the latest version has security patches implemented, which are lacking in the older ones. Additionally, you may use any version of these components, but keep in mind that they are compatible with each other and are secure enough to handle intruders.
Installing components
Once you have the previously mentioned installers ready, you may proceed with the installation by performing the following steps:
- Install XAMPP and follow the instructions.
- Install the latest Java JDK.
- Install Tomcat and follow the instructions.
- By now, there must be a folder called
/xampp
in yourC:
(by default). Navigate to thexampp
folder, find thexampp-control
application, and start it, as shown in the following screenshot: - Start Apache, MySQL, and Tomcat services, and click on the Services button present at the right-hand side of the panel, as shown in the following screenshot:
- Locate Apache Tomcat Service, right-click on it, and navigate to Properties, as shown in the following screenshot:
- After the Properties window pops up, set the Startup type property to Automatic, and close the window by clicking on OK, as shown in the following screenshot:
- For the next few steps, we will stop Apache Tomcat in the Services window. If this doesn't work, click on the Stop option.
- Extract Apache Solr and navigate to the
/dist
folder. You will find a file calledsolr-4.3.1.war
, as shown in the following screenshot (we need to copy this file): - Navigate to
C:/xampp/tomcat/webapps/
and paste thesolr-4.3.1.war
file (which you copied in the previous step) into thewebapps
folder. Renamesolr-4.3.1.war
tosolr.war
, as shown in the following screenshot: - Navigate back to
<ApacheSolrFolder>/example/solr/
and copy thebin
andcollection1
files, as shown in the following screenshot: - Create a directory in
C:/xampp/
called/solr/
and paste theApacheSolrFolder>/example/solr/
files into this directory, that is,C:/xampp/solr
, as shown in the following screenshot: - Now, navigate to
C:/xampp/tomcat/bin/tomcat6
, click on the Java tab, and copy the command-Dsolr.solr.home=C:\xampp\solr
into the Java Options section, as shown in the following screenshot: - Now its time to navigate to the Services window. Start Apache Tomcat in the Services window.
- Now, you are done with installing Apache Solr in your local environment. To confirm, type
http://localhost:8080/solr/admin/
and hit the Enter key on the keyboard. You should be able to see Apache Solr's dashboard.