140 likes | 258 Vues
This document provides a detailed overview of the LifeDesk system architecture, including its site creation procedures, administrative installation in Drupal, and deployment methodologies. It outlines the structure of directories, the deployment process through load balancers, application servers, and MySQL databases. Users can explore the marketing pages, error handling, and necessary modules for multisite functionality. Additionally, the text discusses the code management practices such as local development, SVN commits, and public access to marketing page downloads of modules.
E N D
LifeDesk: Codebase & Overview David P. Shorthouse Vitthal Kudal
Overview • Site creation procedure (demo) • System architecture • Marketing pages • Administrative Drupal install • Directory structure • Deployment • Codebase
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)
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
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)
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
Directory Structure Administrative Installation Individual LifeDesks
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
Installation Profiles • Installs modules • Sets variables • Sets permissions • Selects theme
LifeDesks Files • Each contains folders for: • Images • Classification import/export • EOL content partner documents • Directory name same as subdomain AND database
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
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; }
Code Management • Development: local machines & commit to svn • Subversion: trunk, branches, tags • Public access: marketing page download of modules