350 likes | 450 Views
Managing Drupal with Aegir. Chris Burge Burge Consulting, LLC. Dublin, Ireland Drupal Dev Days. 30 June 2013. Creating a New Site. Create directory space (& deal with permissions) Deploy codebase (& deal with permissions) Configure Apache Restart Apache Create database
E N D
Managing Drupal with Aegir Chris BurgeBurge Consulting, LLC Dublin, Ireland Drupal Dev Days 30 June 2013
Creating a New Site • Create directory space (& deal with permissions) • Deploy codebase (& deal with permissions) • Configure Apache • Restart Apache • Create database • Create database user • Assign database permissions • Enter database credentials into settings.php • Run Drupal installer
What is Aegir? “The Aegir hosting system allows developers and site administrators to automate many of the common tasks associated with deploying and managing large websites. Aegir makes it easy to install, upgrade, deploy, and backup an entire network of Drupal sites.”Source: http://www.aegirproject.org/
What is Aegir? “The Aegir hosting system allows developers and site administrators to automate many of the common tasks associated with deploying and managing large websites. Aegir makes it easy to install, upgrade, deploy, and backup an entire network of Drupal sites.”Source: http://www.aegirproject.org/
Aegir Basics • Server • Web server (Apache) • Database server (MySQL) • Platform • Drupal 6.28 • Drupal 7.22 • Site • blog.chrisburge.net • Client • Somewhat similar to a role • Day Cloud Studios (daycloudstudios) • Two users, lhunt and mvassios, are assigned to ‘daycloudstudios’ client
Site C Site D Site G Site H Site B Site F Site A Site E Platform Platform Platform Platform Web Server Web Server
Database Server Database Server Site C Site D Site G Site H Site B Site F Site A Site E Platform Platform Platform Platform Web Server Web Server
Database Server Database Server Site C Site D Site G Site H Site B Site F Site A Site E Platform Platform Platform Platform Web Server Web Server
Installation • Install system requirements # yum install httpd php php-mysql php-cli php-gd php-process sudo rsync git postfix mysql-server • Create user ‘aegir’ and add to group ‘apache’ # useradd --home-dir /var/aegir aegir # gpasswd -a aegir apache # chmod -R 755 /var/aegir
Installation • Create Apache configuration file symlink # ln -s /var/aegir/config/apache.conf /etc/apache2/conf.d/aegir.conf • Grant ‘aegir’ permission to restart Apache • Open ‘sudoers’ file # visudo • Insert configuration below: Defaults:aegir !requiretty aegir ALL=NOPASSWD: /usr/sbin/apachectl
Installation • Install Drush # pear channel-discover pear.drush.org # pear install drush/drush-4.5.0 • Become user ‘aegir’ # sudo –u aegir –i
Installation • Install provision • Provision is the backend of Aegir # drush dl --destination=/var/aegir/.drush provision-6.x • Install hostmaster • Hostmaster is the frontend of Aegir # drushhostmaster-install (Hostmaster is a Drupal profile and runs on Drupal 6.x)
Make Files ; Drush Make (http://drupal.org/project/drush_make) api = 2 core = 7.x ; Drupal core projects[drupal][type] = coreprojects[drupal][version] = 7.22 projects[wysiwyg][subdir] = contrib projects[wysiwyg][version] = 2.2 projects[views][subdir] = contrib projects[views][version] = 3.7 projects[views][patch][1744478] = http://drupal.org/files/views-fill_up_single_row-1744478-8.patch
Make Files projects[views_php][subdir] = contrib projects[views_php][type] = module projects[views_php][download][type] = git projects[views_php][download][url] = http://git.drupal.org/project/views_php.git ;projects[views_php][download][branch] = 7.x-1.x projects[views_php][download][revision] = 2b5ed52228394ee3c8e8c86be283da957cdfa6f6 ; CKEditor 3.6.2 libraries[ckeditor][download][type] = file libraries[ckeditor][download][url] = "http://download.cksource.com/CKEditor/CKEditor/CKEditor%203.6.6/ckeditor_3.6.6.tar.gz" libraries[ckeditor][directory_name] = ckeditor libraries[ckeditor][type] = library
Custom Hooks • Aegir provides hooks • E.g. add MemCache config to settings.php • Create file customhook.drush.inc in /var/aegir/.drush function customhook_provision_drupal_config($uri,$data) { if($uri==”aegir.chrisburge.net") { return NULL; } ### Memcache ## Make a unique key for a site (special character not permitted) $unique = str_replace('.','',str_replace('-','',$uri)); $returnArray [] = "### Memcache ### \$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc'; // the path to the core cache file include_once('./includes/cache.inc'); // the path to the memcache cache file include_once('./sites/all/modules/contrib/memcache/memcache.inc'); // make MemCacheDrupal the default cache class \$conf['cache_default_class'] = 'MemCacheDrupal'; # Key Prefix: edit this for multisite use. \$conf['memcache_key_prefix'] = \"$unique\"; \$conf['memcache_servers'] = array( '127.0.0.1:11211' => 'default', ); \$conf['memcache_bins'] = array( 'cache' => 'default', ); ”; return $returnArray; }
Links • Aegir • http://www.aegirproject.org/ • http://community.aegirproject.org/ • http://drupal.org/project/provision • http://drupal.org/project/hostmaster • Drush • http://drush.ws/ • http://drupal.org/project/drush • http://drupal.org/project/drush_make