Installing Solr on Debian 6.0

Update: this is an old blog post, Solr is now included in Debian since 7.0, it can be installed through apt-get by calling apt-get install solr-tomcat.

Recently I've been working on a Django project that uses the Haystack search API and the Solr search engine to perform full text searching on indexed data.

This project was initially deployed on a Debian 5.0 (Lenny) server with some issues with Tomcat, but using the latest stable release of Debian (code named Squeeze) install Tomcat 6 and Solr is very easy.

Just run the following

apt-get install tomcat6 tomcat6-admin

download and install the latest version of Solr

wget http://apache.cict.fr//lucene/solr/1.4.1/apache-solr-1.4.1.tgz
tar xvfz apache-solr-1.4.1.tgz
cd apache-solr-1.4.1
cp dist/apache-solr-1.4.1.war /var/lib/tomcat6/webapps/solr.war
cp -fr example/solr /var/lib/tomcat6/
chown -R tomcat6:tomcat6 /var/lib/tomcat6/solr

after install Solr you need to restart the tomcat6 service

/etc/init.d/tomcat6 restart

And voilĂ , Solr is running. Point your browser to http://localhost:8080/solr/admin this should show the Solr Admin interface.