badcamp 2008 core crazy

Post on 19-Jun-2015

914 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

http://badcamp.net/session/core-crazy

TRANSCRIPT

Core CrazyShaun Haber

Warner Bros. Records

What is it?

• Basically, a look into how Warner Bros. Records uses Drupal!

Who the hell am I?

Warner Music Group

Warner Bros. Records

• Subsidiary of Warner Music Group

• Family of labels (Reprise, Sire, etc.)

• Over 100 artists

• Top-selling albums

• It’s music biz after all!

So what?

WBR Tech

• Only label with an in-house Tech team

• “Start-up” mentality

• Fast-paced, hectic, and fun!

• We use Drupal... religiously

93 Drupal Sites1 new site every week

Launching like crazy!

How do we do it?

It’s not magic!

Give each website its own vhost!

Drupal core and vhosts

Conf:DocumentRoot /path/to/drupal/core

BAD

Drupal core and vhostsConf:DocumentRoot /path/to/website

File System:/path/to/website -> /path/to/drupal/core

GOOD

Why?

• Flexibility

• Maintainability

• Core Crazy!

Remember these items

• Apache’s mod_vhost_alias

• Symbolic links

• Subversion

• Drupal’s CVS

• Shell scripts

Mod_vhost_alias

• Dynamic vhosts!

It’s a VirtualDocumentRoot

VirtualDocumentRoot /websites/%0

iamlights.com /websites/iamlights.com

ericbenet.net /websites/ericbenet.net

tour.remhq.com /websites/tour.remhq.com

Why this kicks ass!

• Don’t need to edit conf

• Don’t need to add new vhosts

• Don’t need to restart Apache!

• Seriously, this rocks

2 part domain:VirtualDocumentRoot /websites/%0/www

iamlights.com /websites/iamlights.com/www

ericbenet.net /websites/ericbenet.net/www

tour.remhq.com (see next slide)

3 part domain:VirtualDocumentRoot /websites/%2+/%1

www.iamlights.com /websites/iamlights.com/www

www.ericbenet.net /websites/ericbenet.net/www

tour.remhq.com /websites/remhq.com/tour

Source: http://flickr.com/photos/iguanajo/109613363

Symbolic Links

ln -s /path/to/src alias

iamlights.com

/drupal/5.10

/drupal/5.11

iamlights.com

/drupal/5.10

/drupal/5.11

Simply change the symlink!

/drupal/5.10

/drupal/5.11

/drupal/shared

/sites

/sites

/sites

/drupal/5.10

/drupal/5.11

/drupal/shared

/sites

/sites

/sites

All cores share some stuff!

/drupal/shared

/sites

/lights

/sites/lights

/settings.php

/modules/themes

/drupal/shared

/sites

/lights

/sites/lights

/settings.php

/modules/themes

/iamlights.com

/iamlights.wbrdev.com

Dev and Prod envs!

/sites/lights

/settings.php

/modules

/drupal/modules/contrib

/cck

/5.x-1.6

/5.x-1.7

/cck

/sites/lights

/settings.php

/modules

/drupal/modules/contrib

/cck

/5.x-1.6

/5.x-1.7

/cck

Simply change the symlink!

/drupal/shared

/sites/all

/modules

/drupal/modules/contrib

/admin_menu

/5.x-2.5

Safe modules in sites/all

It’s symlink madness!

Subversion

• /drupal5x /cores /sites /modules /contrib /custom

Drupal CVS

• http://cvs.drupal.org/viewvc.py/drupal/

Shell Script

Questions?

• Shaun Habershaun.haber@wbr.com

http://srhaber.comTwitter: @srhaber

top related