drupal planet

Drupal and Node.js at STLJS Meetup - Thursday, May 15!

STL.JS Meetup LogoI'll be presenting Node.js and Drupal — Working Together at the STL.JS meetup this Thursday, May 15, at The Able Few in St. Louis.

In the presentation, I'll basically be covering how Server Check.in uses Drupal and Node.js to deliver a simple, fast, and stable server monitoring service. During the course of the presentation, I'll touch on why and how Server Check.in was built, how Ansible is used to maintain the infrastructure, and the effectiveness of lightweight marketing, blogging, and 'low end box' servers.

Join me and many JS developers in St. Louis on May 15, and after the presentation, we'll hack on some of the things mentioned in the presentation!

Drupal 8 - A Brief Introduction (DrupalCamp STL.14 Presentation)

I presented Drupal 8 - A Brief Introduction at DrupalCamp STL.14 on April 26, 2014.

Drupal 8 brings a lot of changes. Many standby contributed modules are now included with Drupal Core, and many small changes add up to the most exciting Drupal release yet! This presentation guides you through many of the biggest changes, highlighting how Drupal 8 will accelerate your web development and provide tools to make Drupal the best content management platform on any device.

View the slideshow below, or follow the links at the bottom of the post to view the full presentation and video.

Links for full slideshow/video:

Sessions at DrupalCon and DrupalCamp

I mentioned this elsewhere (see: DrupalCon and DrupalCamp news), but I'll post here as well; I'm going to be speaking at both DrupalCon Austin and DrupalCamp St. Louis this year!

I've submitted a few sessions to DrupalCon Austin in the past, mostly surrounding the Honeypot module for Drupal, but this year, a session I submitted in the DevOps track was chosen: DevOps for Humans: Ansible for Drupal Deployment Victory!. I figured since I'm writing a book on Ansible, and I use Ansible to provision servers and do all the deployments for my Drupal sites, I might as well show other Drupal developers how easy it is to get started and how much you can do with Ansible!

DrupalCon and DrupalCamp news + free DrupalCon ticket!

DrupalCon Austin

This week, the DrupalCon Austin sessions have been posted, and I'm thrilled to have one of my session submissions (in the DevOps track) selected: DevOps for Humans: Ansible for Drupal Deployment Victory!.

The session will go over how Ansible can be used to realize faster, easier, and more successful Drupal deployments, as well as Ansible's ability to make sure that every environment is 'like production', so you don't ever have surprises when you deploy code to its final destination.

Announcing DrupalCamp STL.2014 - April 26 in St. Louis, MO

DrupalCamp STL 2014 Logo

St. Louis is getting ready for its first-ever DrupalCamp! On April 26, 2014, DrupalCamp St. Louis will open up with a keynote by Brad Nowak, a Business Development Manager at Palantir. The Camp will have sessions covering a variety of topics, like Drupal 8 and how your business can benefit from Drupal's flexibility. It will be held at Washington University's West Campus in Clayton, MO, just a few blocks from a MetroLink station and only a few minutes away from Downtown St. Louis!

Online registration is open already, and for the next couple of weeks, earlybird registration is only $15! For that tiny fee you get:

Multisite Apache Solr Search with Domain Access

Using one Apache Solr search core with more than one Drupal website isn't too difficult; you simply use a module like Apache Solr Multisite Search, or a technique like the one mentioned in Nick Veenhof's post, Let's talk Apache Solr Multisite. This kind of technique can save you time (and even money!) so you can use one Hosted Apache Solr subscription with multiple sites. The only caveat: any site using the solr core could see any other site's content (which shouldn't be a problem if you control all the sites and don't expose private data through solr).

There are two ways to make Apache Solr Search Integration work with Domain Access (one of which works similarly to the methods mentioned above for multisite), and which method you use depends on how your site's content is structured.

Ansible Playbooks for Drupal 8 Testing and Mac Dev

Lately, I've been working a lot with Ansible, a simple but powerful infrastructure management platform. I now use Ansible playbooks and ad-hoc commands to manage all of Midwestern Mac's infrastructure (this site, Hosted Apache Solr, Server Check.in, and many ancillary servers), and as a result, I've started using Ansible for pretty much any kind of work I need to do in development—including configuring my own Mac, and developing with Drupal 8.

Meet Ansible

Ansible Logo - Black transparent

For those who haven't heard of Ansible before, it's often described as being a little like Puppet or Chef, used for configuration management. You define the configuration of a server, and Ansible makes sure the server is configured as defined. But Ansible goes quite a bit further—it's also great for deploying applications (especially in tandem with tools like Jenkins), running commands on servers, and day-to-day management of a few, hundreds, or even thousands, of servers—it's an end-to-end configuration management tool. Ansible also has a great, and rapidly-growing community, building it up and making it markedly better every release.

Ansible uses YAML to define configuration (just like Drupal 8!), and is relatively easy to pick up, especially if you already have some experience on the command line. You can read more about it in a book I'm writing, Ansible for DevOps, and hopefully, I'll be able to tell you more about Ansible in person at DrupalCon Austin—I've submitted a session titled DevOps for Humans: Ansible for Drupal Deployment Victory! (please leave a comment and let me know what you want to hear!).

Drupal development VM (Vagrant + Ansible)

I used to use MAMP (a simple-to-install Apache + MySQL + PHP setup for Macs) for all my development, which made adding virtual hosts to Apache relatively simple. However, there are many downsides to developing with MAMP—I could never configure things like drush, APC, the version of PHP, MySQL, or auxiliary tools like XDebug and Solr, exactly how I wanted or needed them.

Vagrant - NFS shared folders for Mac/Linux hosts, Samba shares for Windows

[Edit: I'm not using rsync shared folders (a new feature in 1.5+) instead of SMB/NFS - please see this post for more info: rsync in Vagrant 1.5 improves file performance and Windows usage].

[Edit 2: Some people have reported success using the vagrant-winnfsd plugin to use NFS in Windows.]

I've been using Vagrant to provision local development and testing VMs for a couple years, and on my Mac, NFS shared folders (which are supported natively by VirtualBox) work great; they're many, many times faster than native shared folders. To set up an NFS share in your Vagrantfile, just make sure the nfs-utils package is installed on the managed VM, and add the following:

    config.vm.synced_folder "~/Sites/shared", "/shared",
      :nfs => !is_windows,
      id: "shared"

Note: See JJG-Ansible-Windows to see how you can get the is_windows variable.

Debugging Varnish VCL configuration files

If you're a Drupal or PHP developer used to debugging or troubleshooting some code by adding a print $variable; or dpm($object); to your PHP, and then refreshing the page to see the debug message (or using XDebug, or using watchdog logging...), debugging Varnish's VCL language can be intimidating.

VCL uses C-like syntax, and is compiled when varnish starts, so you can't just modify a .vcl file and refresh to see changes or debug something. And there are only a few places where you can simply stick a debug statement. So, I'll explain four different ways I use to debug VCLs in this post (note: don't do this on a production server!):

Simple Error statements (like print in PHP)

Sometimes, all you need to do is see the output of a variable, like req.http.Cookie, inside vcl_recv(). In these cases, you can just add an error statement to throw an error in Varnish and output the contents of a string, like the Cookie:

Drupal 2014 - New Year's Resolutions

2014 is going to be a big year for Drupal. I spent a lot of 2013 sprucing up services like Hosted Apache Solr and Server Check.in (both running on Drupal 7 currently), and porting some of my Drupal projects to Drupal 8.

So far I've made great progress on Honeypot and Wysiwyg Linebreaks, which I started migrating a while back. Both modules work and pass all tests on Drupal's current dev/alpha release, and I plan on following through with the D8CX pledges I made months ago.