Drupal tips

Command line Drupal install and update script for multi-site hosting

Maintaining a Drupal site, or a collection of sites is much easier if everything is kept completely separate--Drupal core, contributed modules, and the site itself.
This is even more important if multiple sites are hosted on the same server. Drupal's own multi-site support can be a nightmare to maintain, believe me! (e.g. when you want to upgrade modules or core).
A must simpler and easily supported configuration is to keep everything separate and to use symbolic links to tie it all together. For example, I keep:

Technical Notes

These notes are my personal online notebook of useful commands and "how-to's". You are welcome to make use of them if you find them helpful. They obviously don't come with any warranty! Click on one of the category tags above for the notes in any category.

Installing Drupal on Ubuntu 14.04

  • Install LAMP stack
apt-get install openssh-server
apt-get install tasksel
tasksel install lamp-server
  • Some basic stuff
apt-get install vim g++ build-essential subversion python-mysqldb ImageMagick php5-gd postfix
echo "<?php phpinfo(); ?>" > /var/www/html/testphp.php
  • visit server and check php is running
  • now add webmin
echo 'deb http://download.webmin.com/download/repository sarge contrib' >> /etc/apt/sources.list
wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add -
apt-get update; apt-get install webmin
  • configure

Webform formatting

As I wrote here:www.drupal.org/…omment-9134347

Webform descriptions can be made to take any tags using:

php -r "print json_encode(array('a', 'em', 'strong', 'code', 'img', 'ul', 'ol', 'li'));"  | drush vset --format=json webform_allowed_tags -
  • The first command generates:
  • which can be written to the variable and checked with:
drush vset --format=json webform_allowed_tags '["a","em","strong","code","img","ul","ol","li"]'
drush vget webform_allowed_tags  # check value is set


So far CloudFlare has proved to be an excellent service. It is very useful for providing extra safety for old Drupal 5 sites that have not yet been upgraded.

JavaScript MVC Frameworks

A new way of creating a website is using what is sometimes called a “headless” site, with the front end being served by an MVC framework (Model View Controller).

Headless Drupal means using Drupal purely for content creation and management and feeding all the data in JSON format to a JavaScript front end.

Installing Open Atrium


  • download no-core version
  • replace all modules in repo with symbolic links
  • create standard Drupal 7 site
  • link openatrium directory into profiles/openatrium
  • install site using openatrium install profile
dget install openatrium 7.x-2.19-no-core d7paths
grep memory_limit /etc/php.ini       #should be >= 256M
grep max_allowed_packet /etc/my.cnf  #should be >= 32M (add under [mysqld]}
  • Go through OA contrib modules and any we have already replace with the one in the repo

function repoa {
  rm -Rf $oa/modules

Drupal and Facebook

Installing RedHen CRM

1. Install modules on server

dget install redhen 7.x-1.7 d7paths
dget install message 7.x-1.9 d7paths
dget install relation 7.x-1.0-rc5 d7paths
dget install registration 7.x-1.3 d7paths
dget install redhen_membership 7.x-1.x-dev d7paths
dget install entityreference 7.x-1.1 d7paths
dget install addressfield 7.x-1.0-beta5 d7paths

  • assume entity, ctools already installed


Drupal performance notes

Here are some useful links:

In case the problem is the underlying system performance:

Syndicate content