Installing the latest version of Apache Solr search engine on a Jetty powered server is very straightforward. You simply copy the packages in the right place, change a few lines to customize it and you are done. This tutorial is meant for Ubuntu users but it can be easily adapted for other distributions.
Assuming you are root (you can become by running "sudo -i" command), the first thing you need to do is get the dependencies:
I recommend the java development kit from Ubuntu but if you want you can also use the one made by Sun (replace "natty" with your own distribution codename):
Download and extract the Jetty server into the /opt folder (Visit http://download.eclipse.org/jetty/ for the latest version):
Download and extract the Apache Solr application into a temporary folder. We don't need the embedded jetty because we have our own. The URL provided is just a mirror so it's best to visit http://lucene.apache.org/solr/ for the latest version and a faster download link:
Next, we need to copy the actual Solr application into Jetty:
Before we start the server we need to add a few options to java:
By modifying the java_options line you can customize/optimize even more or Java environment, but that's outside the scope of this tutorial. For example:
We also need to create the multicore config for Solr:
cp -R /opt/solr/conf /opt/solr/example1.com
cp -R /opt/solr/conf /opt/solr/example2.com
And modify /opt/solr/solr.xml accordingly:
One last thing is to create the user under which all this will run, set the right permissions and check if everything is in order with Jetty:
chown -R jetty:jetty /opt/jetty
chown -R jetty:jetty /opt/solr
/opt/jetty/bin/jetty.sh check
If everything is in order you can start Jetty and even configure it to run at bootup:
ln -s /opt/jetty/bin/jetty.sh /etc /init.d/jetty
update-rc.d -f jetty defaults
That's it; you now have the latest Apache Solr engine on the latest Jetty web server.
If you found this useful and you want to contribute, please consider sending a donation (click the button below).
Comments
Using solr-jetty package?
Updated version
That's because I like having the latest version of the software I use. And the Ubuntu solr-jetty package is still 1.4.0+ds1-2ubuntu1 instead of 1.4.1 found on their site. Especially when the Solr package comes in a simple .war file which you copy in your jetty webapps folder.
Error 500 JSP not configured
Permissions
If you didn't modify any of the start-up scripts in your jetty distro then most likely you need to set the permissions for the jetty user to the Solr folder:
Error 500 JSP not configured
Error JSP fixed
new solr 3.1.0
same question here
Solr 3.2.0
I updated the tutorial with the latest version of Jetty and Solr.
missing solr.xml changes?
Pages
Add new comment