1 / 14

LifeDesk: Codebase & Overview

LifeDesk: Codebase & Overview. David P. Shorthouse Vitthal Kudal. Overview. Site creation procedure (demo) System architecture Marketing pages Administrative Drupal install Directory structure Deployment Codebase. Site Creation Demo. DNS & Subdomains.

Download Presentation

LifeDesk: Codebase & Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LifeDesk: Codebase & Overview David P. Shorthouse Vitthal Kudal

  2. Overview • Site creation procedure (demo) • System architecture • Marketing pages • Administrative Drupal install • Directory structure • Deployment • Codebase

  3. Site Creation Demo

  4. DNS & Subdomains • Wildcard DNS entry for *.lifedesks.org • Every LifeDesk has its own subdomain & database • All traffic passed through load balancer(s) to application server(s), which connects to MySQL server(s)

  5. System Architecture • Load Balancer: nginx, FastCGI, PHP • Serves flat HTML marketing pages (some PHP, via FastCGI e.g. search, site creation) • Application Server: Apache, PHP • LifeDesk/Drupal code • Database Server: MySQL

  6. Marketing Pages • Mostly flat HTML pages for high volume • POSTs to administrative Drupal install • Gallery of sites, RSS Feeds • Connection to administrative Drupal db • Search • Downstream error handling (e.g. HTTP 404, 502, etc. errors from application server)

  7. Administrative Drupal Install • Receives POSTed content from marketing pages • Creates database for each site & manages database connections via settings.php • Modules required for multisite • multisite_manager • profile_master

  8. Directory Structure Administrative Installation Individual LifeDesks

  9. Drupal settings.php Files $db_prefix = ""; $base_url = "http://admin.lifedesks.org"; $db_url = "mysqli://lifedesk:lifedesk@localhost/lifedesk_production"; $conf['file_directory_path'] = "files/"; Administrative Installation $db_prefix = ""; $urlParts = explode('.', $_SERVER['HTTP_HOST']); $subd = $urlParts[0]; $base_url = "http://" . $subd . ".lifedesks.org"; $db_url = 'mysqli://lifedesk:lifedesk@localhost/' . $subd; $conf['file_directory_path'] = "files/" . $subd; $conf['theme_default'] = 'eol'; $conf['maintenance_theme'] = "eol"; Individual LifeDesks

  10. Installation Profiles • Installs modules • Sets variables • Sets permissions • Selects theme

  11. LifeDesks Files • Each contains folders for: • Images • Classification import/export • EOL content partner documents • Directory name same as subdomain AND database

  12. Deployment • Hand-scripted deployment (~ Capistrano) • Prior to deployment: code & db back-up • Update sites script • Similar to Drupal’s update.php • Installs new modules as required • “reads” and applies update hooks

  13. Update Hooks • Drupal convention function classification_update_6103() { $ret = array(); switch ($GLOBALS['db_type']) { case 'mysql': case 'mysqli': $ret[] = update_sql("INSERT INTO term_relation_types (rtid,name) VALUES (11,'replaced name');"); $ret[] = update_sql("INSERT INTO term_relation_types (rtid,name) VALUES (12,'basionym');"); break; case 'pgsql': $ret[] = update_sql("INSERT INTO term_relation_types (rtid,name) VALUES (11,'replaced name');"); $ret[] = update_sql("INSERT INTO term_relation_types (rtid,name) VALUES (12,'basionym');"); break; } return $ret; }

  14. Code Management • Development: local machines & commit to svn • Subversion: trunk, branches, tags • Public access: marketing page download of modules

More Related