Debian Lenny Solr Jetty install + running - solr

I want to setup search for my site. I couldn't find much information to install Jetty + Solr on my linode.
I could install solr-jetty on ubuntu simply using apt-get. any body has better experience with debian?

You shouldn't need to install it through the package manager. Jetty is deployed with Solr from the Solr homepage. So long as you have java installed on your server you can simply unpack the Solr distibution, read example/README.txt

Related

Jetty not starting in installing ckan from package ubuntu 14.04

I am trying to install CKAN from package on ubuntu 14.04 using the latest docs.
So while setting up solr when I execute the command:
sudo service jetty restart
I get this on my terminal:
* Starting Jetty servlet engine. jetty
* /var/run/jetty.pid exists, but jetty was not running. Ignoring /var/run/jetty.pid
/etc/init.d/jetty: 274: /etc/init.d/jetty: /usr/sbin/rotatelogs: not found
* Jetty servlet engine started, reachable on http://ammar-HP-ProBook-450-G4:8983/. jetty [fail]
Hence I cannot see a solr welcome page on localhost:8983/solr/
Help Please...
I'm not sure why its used a different hostname to localhost, but it sounds it is running on this slightly different address and you can simply configure CKAN to use it:
solr_url=http://ammar-HP-ProBook-450-G4:8983/solr

Mint 18.1, Ckan, SOLR schema version not supported

I'm a front-end developer and I need to do a Ckan Theme. To do so, I need a working source install of CKAN on my system. I'm using Mint 18.1 and installing Ckan 2.6.2.
Following the steps of the installation of ckan's docs I've got a warning and an error at step 6 as shown on the image.
As you can see the last line says SOLR schema version not supported: 2.7. Supported versions are [2.3] and I can't proceed with the installation. Searching on the Internet I found people having the same problem, but using Docker (have no idea what is this) and their solutions didn't work for me.
Because I have a really short time to build this theme I gave up CKAN 2.6.2 and installd 2.5.2 and everything worked fine.
The SOLR schema that comes with CKAN 2.6.2 is version 2.3, so somehow you have got 2.7, which is provided with later versions of CKAN. Maybe you installed CKAN master and the schema is lingering from then.
Here are some steps so that you can find out where the problem is:
You can check the version of the schema in the CKAN source repo on your disk:
grep 'name="ckan" version=' /usr/lib/ckan/default/src/ckan/ckan/config/solr/schema.xml
You would have then installed this file into Solr (in Step 5, using the 'ln' command). You can check the version in Solr:
grep 'name="ckan" version=' /etc/solr/conf/schema.xml
(When this file is changed, you need to restart SOLR (i.e. jetty) for it to take effect - see the docs again).
You can see what schema SOLR is actually using:
curl -s 'http://localhost:8983/solr/admin/file/?contentType=text/xml;charset=utf-8&file=schema.xml'|grep 'name="ckan" version='
Please do feed back on these.
It sounds like your Docker container for SOLR is a newer version than that is not compatible with CKAN 2.6.2.

Mongodb on plesk 12.5 and Ubuntu

I tried trying to install mongodb and php extension on my server with Ubuntu 14.04 and plesk 12.5 but without success of php extension. Anyone can help me with a simple tutorial on how to install mongodb driver and Mongo db php extension on my dedicated server?
Thanks
You can look on official documentation
DigitalOcean provides a detailed recipe: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
PHP MongoDB extension: installation from PECL
Forum AskUbuntu
Here you can see how you're installing multiple versions of PHP and switching them in Plesk.
Mind that you install every PHP version independently with its own extensions.
In your case you need to add MongoDB extension to some (or all) PHP versions you work with.

ckan local installation, 500 error on solr JSP support not configured

I am trying to install CKAN on my local computer using Ubuntu 14.04 LTS.
I followed the instructions for installing from source found here and I try to check if solr is running by visiting http://localhost:8983/solr/.
I can see that Jetty is running because when I visit http://localhost:8983 I see that it is up.
I added the jdk as follows:
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64
I am getting a 500 error when i try to open the solr page:
HTTP ERROR 500
Problem accessing /solr/index.jsp. Reason:
JSP support not configured
Powered by Jetty://
Any ideas? Should I redo the whole thing from the start?
Edit/Update
I just couldn't do anything with this installation. The bigger problem was that installation files were meshed up! I tried to install tomcat/solr instead of jetty/solr and things went sour. So I just created a VM and did a fresh install there. For anyone interested I did a tomcat/solr installation following this and a CKAN installation following this (with out of course the solr instructions). Also, for some reason the CKAN installation has commented out the solr URL, so even if it is right, I had to delete the comment.
A fix has been documented by #mstantoncook here [2939] & [1651] How to solr-jetty JSP support
Note the last comment, sudo service jetty restart
It's a Jetty BUG on Ubuntu 14.04!
There is nothing wrong with Ckan itself.
Actually, there is a bug in the libjetty-extra-java package (version 6.1.26 and newer) in Ubuntu 14.04. The bug was introduced after Jetty (in Ubuntu) has changed it's dependences from libtomcat6-java to libtomcat7-java.
You can get more info about this bug in Ubuntu Launchpad: Bug #1508562 "Broken symlinks for JSP support in libjetty-extra-java version 6.1.26-1ubuntu1.1".
The bug is already fixed on Debian, and I'm hope it will be solved in Ubuntu 14.04 soon.
There are workarounds that may work for your case
I proposed some workarounds in this bug report, and since they can be useful for the Ckan users, I'll also replicate them here.
All of them consist on use both jetty and libtomcat7-java, but adding/replacing some classes (code ported from libtomcat6, in put in the jsp-2.1-6.0.2.jar file) to the Jetty classpath.
I don't know if they have some problem. Use them at your own risk!
Workaround 1 - Install the fix package proposed by vshn
I found this workaround here: https://github.com/ckan/ckan/pull/2966
In short:
wget https://launchpad.net/~vshn/+archive/ubuntu/solr/+files/solr-jetty-jsp-fix_1.0.2_all.deb
dpkg -i solr-jetty-jsp-fix_1.0.2_all.deb
service jetty restart
This will install a JSP jar that works (the file will be named jsp-2.1-6.0.2.jar, but it contains classes ported from libtomcat6).
Workaround 2 - Manually install the JSP jar
Download the same JAR file that the DEB package above would install.
wget https://bugs.launchpad.net/ubuntu/+source/jetty/+bug/1508562/+attachment/4785985/+files/jsp-2.1-6.0.2.jar
Now, move it to a proper location inside the Jetty config dir. I did it this way:
mkdir /etc/jetty/extra-jars
mv jsp-2.1-6.0.2.jar /etc/jetty/extra-jars
And add a line like this one in the Jetty start.config file:
echo "/etc/jetty/extra-jars/jsp-2.1-6.0.2.jar" >> /etc/jetty/start.config
And:
service jetty restart
Correct solution
The correct solution is to wait for the Ubuntu Team solution. However, while waiting for this fix, you can use any of the previous workarounds (I prefer the last one).
I hope they help you!
Try this steps:
sudo mv jsp-2.1-6.0.2.jar /usr/share/jetty/lib/.
change own:
sudo chown root:root /usr/share/jetty/lib/jsp-2.1-6.0.2.jar
finally restart jetty:
sudo service jetty restart
I followed this steps and now I can see localhost:8983/solr and localhost/solr/admin
In Ubuntu 14.04 this can be fixed with:
cd /tmp
wget https://launchpad.net/~vshn/+archive/ubuntu/solr/+files/solr-jetty-jsp-fix_1.0.2_all.deb
sudo dpkg -i solr-jetty-jsp-fix_1.0.2_all.deb
sudo service jetty restart
Following http://docs.ckan.org/en/ckan-1.6/solr-setup.html#single-solr-instance
(this one a bit old, but worked perfect for me )
You will have to edit /etc/profile and add this line to the end such as this to the end (adjusting the path for your machine’s jdk install:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/ (or other version)
then
export JAVA_HOME
sudo service jetty start

How to install JTS in Solr 4?

Using the Solr 4 spatial field types seems to require an external library, the Java Topology Suite. How does one install this suite for use with Solr 4.1.0 on Ubuntu Server 12.04 with Java 1.6.0_24?
Thank you.
If you are running Solr in Tomcat on your Ubuntu Server and have deployed the Solr WAR into your <path to Tomcat>/webapps folder. Then according to the Lucene / Solr 4 Spatial documentation on the Solr Wiki, you just need to copy the all the jar files from the JTS distribution /lib folder to the WEB-INF/lib folder where Solr is running.
Update
Since you are using Jetty to run Solr, you will need to include the location of the JTS jar files as a classpath. Based on the Classloading Jetty documentation, something like the following should work:
java -Dsolr.solr.home=/mnt/SolrFiles/solr
-Djetty.class.path=<insert path to JTS here> -jar /opt/solr-4.1.0/example/start.jar
The JTS JAR file needs to be placed in the Solr web application's WEB-INF/lib folder. Otherwise you may encounter a NoClassDefFoundError: com/vividsolutions/jts/geom/Geometry when starting Solr.

Resources