Install Solr 6 for Drupal 8 on Ubuntu 16.04

Submitted by christophe on Wed, 26/10/2016 - 21:55


This setup is intended for production use on a dedicated server (VPS, ...).
For development purpose it should be preferable to use Drupal VM, it comes with a default configuration that can be enabled via the config.yml file.

1. Install Search API and Search API Solr modules

Make sure that you download the modules via Composer and not Drush, otherwise you will end up with missing dependencies (like Solarium).

Install Drupal 8 core and contrib modules with Composer

Submitted by christophe on Wed, 26/10/2016 - 14:00


Some modules, like Address or Search API Solr, really needs an installation with Composer.
We should now avoid to rely on Composer Manager (deprecated) so here is a kickstart.

1. Turn off XDebug

If enabled, turn it off, otherwise it will certainly result in a time out.
Edit your php.ini or specific conf file (e.g./etc/php/7.0/cli/conf.d/20-xdebug.ini) and comment the following line :

Alter Views sort by taxonomy weight

Submitted by christophe on Mon, 03/10/2016 - 19:10

The use case is that we want to sort a list of users by job title, where job title is a term reference to a dedicated vocabulary.
The sort is done by the job title term weight (defined via the vocabulary list).

I choosed to apply a custom sort function on a view, instead of a custom dynamic / entity query for two reasons :

Zero configuration Let's Encrypt under Virtualmin

Submitted by christophe on Sat, 10/09/2016 - 09:50

It has been there for a while under Virtualmin, but I was hesitating on using the GUI configuration of Let's Encrypt from Virtualmin on an existing manual configuration. Let's Encrypt does not allow you to make any change afterwards, yielding this error :

Request failed : The native Let's Encrypt client was used previously on this system, and must be used for all future certificate requests.

Drupal 8 links or where is my l() function ?

Submitted by christophe on Thu, 07/04/2016 - 07:24

The l() function is deprecated in Drupal 8, here is a starter.

Import the URL and Link classes :

use Drupal\Core\Url;
use Drupal\Core\Link;

You have several options, but basically, you can start with an url that will be used by a link.
One of the possible implementation will be used, with the Link::fromTextAndUrl method. 

A lightweight MySQL monitoring on Ubuntu

Submitted by christophe on Fri, 01/04/2016 - 16:47

In some situations, you just need a fast way to monitor MySQL and restart your service asap in case of crash. Neither a production script nor a replacement for a real server monitoring tool (like New Relic, ...) with IP fail over, but a basic solution when you just provisioned a low budget VPS with a very limited setup and still want to get a feedback for further logs details.

1) Install mailutils

It will be necessary to send an e-mail alert.

apt-get install mailutils

Kickoff a Drupal 8 development environment

Submitted by christophe on Mon, 08/02/2016 - 10:01

Drupal 8 evolves quickly, and it's easy to get lost amongst the several documentations that have been written since the beta releases, Drush and PHP version needs upgrade. Some things that I have learned.

Option 1 : No VM setup on Mac OSX, via Homebrew

Okay, VM's are easier to maintain solutions, but in some situations you just don't have enough RAM for having Virtualbox running all the time.