-
Installing Solr on Ubuntu Jaunty 9.04
Posted on August 20th, 2009 13 comments
Solr install success on Ubuntu Jaunty 9.04
I just installed Apache Solr on Ubuntu Jaunty 9.04. I am not a Java or Tomcat person, so it was all rather new and a confusing, there was no good install guide and I hit a few walls, so here are some pointers that should get you to a working install.
I am using the command-line install method, so it’s works for desktop and server editions. You can skip the apt-gets and use Synaptics Package Manager to install the packages if you prefer.
1) Install Java
sudo apt-get install sun-java6-bin sun-java6-demo sun-java6-jdk sun-java6-jreI believe the default install of Jaunty installs openjdk java, so you will want to make sure that Sun Java is chosen:
sudo update-alternatives --config javaYou will prompted to pick a version as the default:

Select the Sun Java version
Edit /etc/profile to sent the JAVA_HOME environment variable:
JAVA_HOME=/usr/lib/jvm/java-6-sun
export JAVA_HOME2) Install Tomcat
sudo apt-get install tomcat5.5 libtomcat5.5-java tomcat5.5-admin tomcat5.5-webappsCheck that Tomcat is running:
sudo service tomcat5.5 statusGrant yourself Tomcat Manager and Admin permissions; edit /usr/share/tomcat5.5/conf/tomcat-users.xml and include the following:
<user username="myname" password="mypassword" roles="admin,manager"/>3 Install Solr
sudo apt-get install solr-common solr-tomcat5.5 libxpp3-java(I kept getting “java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException at java.lang.Class.forName0(Native Method)” in the Solr admin page; a little searching led me to find that the problems was that libxpp3-java was not installed. Why it’s not a required package, I don’t know!)
4) Restart Tomcat and Test Solr
sudo service tomcat5.5 restartNow you can go to the Tomcat web admin page at http://localhost:8180/ and login with the credentials you supplied above.
Go to http://localhost:8180/solr/ and do a test query to confirm it’s working.

Of course you will get zero results, you have no content indexed yet.
That should be enough to get started!
12 responses to “Installing Solr on Ubuntu Jaunty 9.04”

-
Nice – I’ll add a link to these instructions from the ApacheSolr Drupal documentation. Are you going to demo Drupal and Solr at BarCamp?
-
Hi! Thanks a lot! That was not so easy to find, as solr-tomcat5.5 has had other problems.
-
Awesome! I had the same error relating to libxpp3-java. Thanks for figuring that out and posting it. Works perfectly now.
-
Just a note for you. If you set the JAVA_HOME by creating a file in /etc/profile.d/ then it woun’t get trashed by some ubuntu update in the future:
echo “export JAVA_HOME=/usr/lib/jvm/java-6-sun”>/etc/profile.d/java-home.sh
-
We’re trying out Solr in conjunction with Django + Haystack. This tutorial really helped me (I dislike the Java/Tomcat world).
-
Thank for your kindness! It is awesome!!
-
thank for sharing but I wanna update that solr version to the newest. Do you know how?
-
for solr on Debian without tomcat. How could i configure solr to start automatically on restart? anyone know?
-
Thank for sharing your experience, It has saved much time for me.
-
Seems better to place env. variables in /etc/environment
http://www.linuxask.com/questions/set-system-wide-environment-variables-in-ubuntu
1 Trackbacks / Pingbacks
Leave a reply
-


Robert Douglass August 20th, 2009 at 17:17