Drupal + WBR
                             How Warner Bros. Records uses Drupal




Tuesday, February 10, 2009
Who am I?
                         Shaun Haber
                         shaun.haber@wbr.com

                         Lead...
My short talk
                    1. Background of Drupal at WBR

                    2. Environment setup

              ...
Tuesday, February 10, 2009
Warner Music Group




Tuesday, February 10, 2009
Tuesday, February 10, 2009
WBR Tech

                    • In-house Tech team
                    • “Start-up” mentality
                    • Fast-p...
100+ Drupal Sites
                                 Since October 2006




Tuesday, February 10, 2009
Tuesday, February 10, 2009
My short talk
                    1. Background of Drupal at WBR

                    2. Environment setup

              ...
Environment Setup
                    • DNS                      • Serving external pages
                    • Apache mod...
DNS




Tuesday, February 10, 2009
Apache mod_vhost_alias
                             Dynamically created virtual hosts




Tuesday, February 10, 2009
Directory Structure
                    •        Directory of web roots

                    •        Directory of Drupal ...
Web roots directory




Tuesday, February 10, 2009
Drupal env directory




Tuesday, February 10, 2009
Drupal env directory




Tuesday, February 10, 2009
Drupal cores directory




Tuesday, February 10, 2009
Drupal cores directory




Tuesday, February 10, 2009
Drupal sites directory




Tuesday, February 10, 2009
Drupal sites directory




Tuesday, February 10, 2009
Drupal sites directory




                                     monikers


Tuesday, February 10, 2009
Drupal modules directory




Tuesday, February 10, 2009
Drupal modules directory




Tuesday, February 10, 2009
CCK module directory




Tuesday, February 10, 2009
CCK module directory




Tuesday, February 10, 2009
sites/all/modules directory




Tuesday, February 10, 2009
sites/[moniker]/modules directory




Tuesday, February 10, 2009
Serving external pages?
                    ★ http://theveronicas.com/foo

                    ★ http://disturbed1.com/foo...
Use mod_rewrite




Tuesday, February 10, 2009
Site directory

                                      Virtual Drupal root




Tuesday, February 10, 2009
Using a CDN
                    •        Use RewriteRules

                    •        Symlink to pickup zone




Tuesday...
RewriteRule example




Tuesday, February 10, 2009
Use a symlink for files




                                 Read by Akamai’s servers




Tuesday, February 10, 2009
Cron
                    •        Run cron as a command-line PHP script.

                    •        Input list of sites...
Environment Setup
                                   Recap
                    • DNS                      • Serving extern...
My short talk
                    1. Background of Drupal at WBR

                    2. Environment setup

              ...
Development Workflow
                    •        Subversion repository

                    •        Provisioning a dev si...
Subversion Repository




Tuesday, February 10, 2009
Provisioning a Dev site
                    •        Name the site (moniker!).

                    •        Create vhost....
Development Cycle
                                               SVN


                             update
               ...
Remote SVN Update




Tuesday, February 10, 2009
Deploying a site

                              •   Code

                              •   Database

                    ...
Code
                    •        Subversion checkout




                                                   checkout
    ...
Database
                    •        Mysqldump + gzip + scp

                    •        Search/Replace dev environment ...
Files
                    •        Tar + gzip + scp

                    •        RewriteRules for CDN




Tuesday, Februa...
Configs
                    •        Change file paths

                    •        Turn on caching

                    • ...
Development on a Production site

                    •        Code already handled by SVN

                    •        T...
Database Synchronization
                    1. Take dev site down

                    2. Shift sequenced IDs on Dev

   ...
3
                                 2
                             1

Tuesday, February 10, 2009
3       3
                                 2       2
                             1       1

Tuesday, February 10, 2009
6
                             5           5
                             4       4
                             3       3...
11
                             10

                                          6
                                          ...
11
                             10

                                  6       6
                                  5       ...
11
                             10
                                 6       6
                              5          5
 ...
11
                             10
                                 6       6
                              5          5
 ...
11
                             10
                                 6       6
                              5          5
 ...
Development Workflow
                                    Recap
                    •        Subversion repository

        ...
My short talk
                    1. Background of Drupal at WBR

                    2. Environment setup

              ...
Demo



Tuesday, February 10, 2009
Asyncronous Data
                                  Processing
                    •        Pull model

                   ...
Pull model
                    •        Create a site node type

                             •   Stores db info, document...
01Detail Module Overview

                        Shaun Haber
                        Fri Jan 16 2009
                    ...
Push model
                    •        Setup site with actions and triggers.

                    •        Setup a messag...
Questions?
                         Shaun Haber
                         shaun.haber@wbr.com

                         Lea...
Upcoming SlideShare
Loading in...5
×

Drupal + WBR

1,266

Published on

SF Drupal user group meetup, Feb 2009. How WBR uses Drupal.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,266
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide



























































  • Drupal + WBR

    1. 1. Drupal + WBR How Warner Bros. Records uses Drupal Tuesday, February 10, 2009
    2. 2. Who am I? Shaun Haber shaun.haber@wbr.com Lead architect, developer, administrator for Warner Bros. Records Tuesday, February 10, 2009
    3. 3. My short talk 1. Background of Drupal at WBR 2. Environment setup 3. Development workflow 4. Site implementation Tuesday, February 10, 2009
    4. 4. Tuesday, February 10, 2009
    5. 5. Warner Music Group Tuesday, February 10, 2009
    6. 6. Tuesday, February 10, 2009
    7. 7. WBR Tech • In-house Tech team • “Start-up” mentality • Fast-paced, hectic, and fun! • We use Drupal... religiously Tuesday, February 10, 2009
    8. 8. 100+ Drupal Sites Since October 2006 Tuesday, February 10, 2009
    9. 9. Tuesday, February 10, 2009
    10. 10. My short talk 1. Background of Drupal at WBR 2. Environment setup 3. Development workflow 4. Site implementation Tuesday, February 10, 2009
    11. 11. Environment Setup • DNS • Serving external pages • Apache mod_vhost_alias • Using a CDN • Directory structure • Cron • Shared code-base • Symbolic links • Monikers Tuesday, February 10, 2009
    12. 12. DNS Tuesday, February 10, 2009
    13. 13. Apache mod_vhost_alias Dynamically created virtual hosts Tuesday, February 10, 2009
    14. 14. Directory Structure • Directory of web roots • Directory of Drupal cores • Directory of contributed (and custom) modules • Directory of Drupal sites • All pieced together by symbolic links! Tuesday, February 10, 2009
    15. 15. Web roots directory Tuesday, February 10, 2009
    16. 16. Drupal env directory Tuesday, February 10, 2009
    17. 17. Drupal env directory Tuesday, February 10, 2009
    18. 18. Drupal cores directory Tuesday, February 10, 2009
    19. 19. Drupal cores directory Tuesday, February 10, 2009
    20. 20. Drupal sites directory Tuesday, February 10, 2009
    21. 21. Drupal sites directory Tuesday, February 10, 2009
    22. 22. Drupal sites directory monikers Tuesday, February 10, 2009
    23. 23. Drupal modules directory Tuesday, February 10, 2009
    24. 24. Drupal modules directory Tuesday, February 10, 2009
    25. 25. CCK module directory Tuesday, February 10, 2009
    26. 26. CCK module directory Tuesday, February 10, 2009
    27. 27. sites/all/modules directory Tuesday, February 10, 2009
    28. 28. sites/[moniker]/modules directory Tuesday, February 10, 2009
    29. 29. Serving external pages? ★ http://theveronicas.com/foo ★ http://disturbed1.com/foo • Problem: These should be two separate pages. How to implement using a shared code-base? • Solution: Don’t place site-exclusive files in Drupal root. Instead, place each file in a dedicated location and tell Apache to check there first. Tuesday, February 10, 2009
    30. 30. Use mod_rewrite Tuesday, February 10, 2009
    31. 31. Site directory Virtual Drupal root Tuesday, February 10, 2009
    32. 32. Using a CDN • Use RewriteRules • Symlink to pickup zone Tuesday, February 10, 2009
    33. 33. RewriteRule example Tuesday, February 10, 2009
    34. 34. Use a symlink for files Read by Akamai’s servers Tuesday, February 10, 2009
    35. 35. Cron • Run cron as a command-line PHP script. • Input list of sites and run cron for each site. Tuesday, February 10, 2009
    36. 36. Environment Setup Recap • DNS • Serving external pages • Apache mod_vhost_alias • Using a CDN • Directory structure • Cron • Shared code-base • Symbolic links • Monikers Tuesday, February 10, 2009
    37. 37. My short talk 1. Background of Drupal at WBR 2. Environment setup 3. Development workflow 4. Site implementation Tuesday, February 10, 2009
    38. 38. Development Workflow • Subversion repository • Provisioning a dev site • Development cycle • Deploying a site • Development on a production site • Database synchronization Tuesday, February 10, 2009
    39. 39. Subversion Repository Tuesday, February 10, 2009
    40. 40. Provisioning a Dev site • Name the site (moniker!). • Create vhost. • SVN Copy skel site folder. • Create symlink(s) in drupal sites folder. • Create database. • Populate settings.php. • Run install.php. Tuesday, February 10, 2009
    41. 41. Development Cycle SVN update update update commit Local Dev Prod Tuesday, February 10, 2009
    42. 42. Remote SVN Update Tuesday, February 10, 2009
    43. 43. Deploying a site • Code • Database • Files • Configs Tuesday, February 10, 2009
    44. 44. Code • Subversion checkout checkout SVN Prod Tuesday, February 10, 2009
    45. 45. Database • Mysqldump + gzip + scp • Search/Replace dev environment strings • UPDATE files SET filepath = REPLACE(filepath, ‘mutemath.wbrdev.com’, ‘mutemath’ • UPDATE system SET filename = REPLACE(filename, ‘mutemath.wbrdev.com’, ‘mutemath’ • Create and populate settings.php file Tuesday, February 10, 2009
    46. 46. Files • Tar + gzip + scp • RewriteRules for CDN Tuesday, February 10, 2009
    47. 47. Configs • Change file paths • Turn on caching • Turn off error log to display • Disable devel and watchdog modules • Etc. Tuesday, February 10, 2009
    48. 48. Development on a Production site • Code already handled by SVN • Take snapshot of production DB, copy to dev • Copy files over to dev • Change paths, configs • Obfuscate email addresses • Take note of date and sequences table (D5 only) Tuesday, February 10, 2009
    49. 49. Database Synchronization 1. Take dev site down 2. Shift sequenced IDs on Dev 3. Take prod site down 4. Merge content from Prod to Dev 5. QA “new” dev site 6. Copy dev site to prod site 7. Bring “new” prod site live Tuesday, February 10, 2009
    50. 50. 3 2 1 Tuesday, February 10, 2009
    51. 51. 3 3 2 2 1 1 Tuesday, February 10, 2009
    52. 52. 6 5 5 4 4 3 3 2 2 1 1 Tuesday, February 10, 2009
    53. 53. 11 10 6 5 4 3 3 2 2 1 1 Tuesday, February 10, 2009
    54. 54. 11 10 6 6 5 5 4 4 3 3 2 2 1 1 Tuesday, February 10, 2009
    55. 55. 11 10 6 6 5 5 4 4 3 3 2 2 1 1 Tuesday, February 10, 2009
    56. 56. 11 10 6 6 5 5 4 4 3 3 2a 2a 1 1 Tuesday, February 10, 2009
    57. 57. 11 10 6 6 5 5 4 4 3 3 2a 2a 1 1 Tuesday, February 10, 2009
    58. 58. Development Workflow Recap • Subversion repository • Provisioning a dev site • Development cycle • Deploying a site • Development on a production site • Database synchronization Tuesday, February 10, 2009
    59. 59. My short talk 1. Background of Drupal at WBR 2. Environment setup 3. Development workflow 4. Site implementation Tuesday, February 10, 2009
    60. 60. Demo Tuesday, February 10, 2009
    61. 61. Asyncronous Data Processing • Pull model • Push model Tuesday, February 10, 2009
    62. 62. Pull model • Create a site node type • Stores db info, document root, URL, 3rd-party API keys, etc. • Create acquisition layer • Aggregate data • Generate views Tuesday, February 10, 2009
    63. 63. 01Detail Module Overview Shaun Haber Fri Jan 16 2009 Report Filtered View Chart Aggregator Vendor API Bootstrap Query Env Master User (Service) (XML-RPC) (MySQL) (OS) (API) Site List Tuesday, February 10, 2009
    64. 64. Push model • Setup site with actions and triggers. • Setup a message queue system (Spread Toolkit). • Asynchronously send data via Spread daemon for further processing. • XML-RPC callback to the site when data processing completes. Tuesday, February 10, 2009
    65. 65. Questions? Shaun Haber shaun.haber@wbr.com Lead architect, developer, administrator for Warner Bros. Records Tuesday, February 10, 2009

    ×