Installation

Install Java 8 Installer

sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Installation of Solr

cd /tmp
sudo wget http://www.us.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz
sudo tar xzf solr-6.6.0.tgz solr-6.6.0/bin/install_solr_service.sh --strip-components=2
sudo ./install_solr_service.sh solr-6.6.0.tgz

Test that solr is running with the following command:

service solr status

Configure solr

Create a collection - replace <name>

sudo su - solr -c "/opt/solr/bin/solr create -c <name> -n data_driven_schema_configs"

Drupal

Replace the default solr conf with configuration from the https://www.drupal.org/project/search_api_solr module.

cd /var/solr/data/<name
rm -Rf conf
wget https://ftp.drupal.org/files/projects/search_api_solr-8.x-1.0.tar.gz
tar -xzvf search_api_solr-8.x-1.0.tar.gz
cp -Rf search_api_solr/solr-conf/6.x conf

Restart solr

sudo service solr restart

The collection is now available from ip-address and the default is 8983