Omar Abdel-Wahab

Installing and Configuring Solr on Gentoo Linux

Lucene is a very nice, robust and flexible search engine. The ways you can benefit from Lucene varies from small library system to a large e-commerce portal.
To unleash Lucene, you either have to use Lucene ported to your favorite language or install Solr and let Solr handle communication with Lucene.
Here we are going to install Solr on a Gentoo Linux box with Tomcat as the servlet container.
To get started, install Tomcat using:

# emerge tomcat

Default Tomcat configuration reserves the port 8080 for Tomcat which is fine unless you have another service running on that port.
Now let's download Solr:

~ $ mkdir solr
~ $ cd solr
~/solr $ wget http://www.poolsaboveground.com/apache/lucene/solr/1.2/apache-solr-1.2.0...
~/solr $ tar zxf apache-solr-1.2.0.tgz

Done with download and unpacking, installing Solr by copying its war file to Tomcat's webapps folder and copy the vanilla solr to solr-home:

~/solr $ cp apache-solr-1.2.0/dist/apache-solr-1.2.0.war /var/lib/tomcat/webapps/solr.war
~/solr $ cp apache-solr-1.2.0/example/solr solr-home

Now we need to specify where is our solr installation:

# echo 'export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/home/USERNAME/solr/solr-home/"' >> /etc/bash/bashrc
# source /etc/bash/bashrc

Finally start Tomcat:

# /etc/init.s/tomcat-6 start

Browse to http://localhost:8080/solr/admin to make sure everything went fine.

Comments

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><p>
  • Glossary terms will be automatically marked with links to their descriptions. If there are certain phrases or sections of text that should be excluded from glossary marking and linking, use the special markup, [no-glossary] ... [/no-glossary]. Additionally, these HTML elements will not be scanned: a, abbr, acronym, code, pre.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options