问题
Is it possible to run Solr 4.4 with jetty 6.1 from Ubuntus package repository? I followed this example: http://www.kingstonlabs.com/blog/how-to-install-solr-36-on-ubuntu-1204/ And tried some other examples, but it seemed to be impossible to run run Solr 4.4 from Jetty's webapps directory.
In the example you can read in the comments, that people ended up with 404 when try to reach
http://localhost:8080/solr
I tried also the configuration steps from the Apache Solr 4 Cookbook by Rafal Kuc, page 6 "Running Solr on Jetty"
Here a summary of the steps:
tar xvfz solr-4.4.0.tgz
sudo cp ~/solr-4.4.0/example/webapps/solr.war /usr/share/jetty/webapps
sudo mkdir /usr/share/jetty/temp
sudo cp ~/solr-4.4.0/example/contexts/solr-jetty-context.xml /usr/share/jetty/contexts
#Change temp dir
sudo vi /usr/share/jetty/contexts/solr-jetty-context.xml
sudo cp ~/solr-4.4.0/example/etc/jetty.xml /usr/share/jetty/etc/
sudo cp ~/solr-4.4.0/example/etc/webdefault.xml /usr/share/jetty/etc/
sudo cp ~/solr-4.4.0/example/etc/logging.properties /usr/share/jetty/etc/
sudo mkdir /usr/share/solr
sudo cp ~/solr-4.4.0/example/solr/solr.xml /usr/share/solr/
sudo mkdir -p /usr/share/solr/collection1/conf
sudo cp ~/solr-4.4.0/example/solr/collection1/conf/schema.xml /usr/share/solr/collection1/conf/
sudo cp ~/solr-4.4.0/example/solr/collection1/conf/solrconfig.xml /usr/share/solr/collection1/conf/
# JETTY_HOME = 0.0.0.0; NO_START=0;
# JAVA_OPTIONS="-Xmx256m -Djava.awt.headless=true -Dsolr.solr.home=/usr/share/solr/"
sudo vi /etc/default/jetty
But
http://localhost:8983/solr
is not reachable afterwards. If found some error messages in the logs and i think that the jetty.xml from the Solr 4.4.0 files which substituting the Jetty 6.1 jetty.xml does not work with the rest of jetty 6.1 I remember so issues in the logs about Java/Jetty Server classes. i think tey differ.
Anybody with experiences in this case an can surely confirm my guess?
回答1:
The clue is to integrate the libs from the solr example directory example/lib/ext into the solr.war.
Extract the files from the solr.war. Then put the libs into the WEB-INF/lib folder. Create a new solr.war with the libs included.
来源:https://stackoverflow.com/questions/19290177/jetty-6-1-with-solr-4-4