CivicActions Drupal Directory Structure
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

CivicActions Drupal Directory Structure

on

  • 3,271 views

This is a short slide deck explaining the CivicActions recommended directory structure for Drupal hosting.

This is a short slide deck explaining the CivicActions recommended directory structure for Drupal hosting.

Statistics

Views

Total Views
3,271
Views on SlideShare
3,158
Embed Views
113

Actions

Likes
0
Downloads
14
Comments
0

5 Embeds 113

http://civicactions.com 99
http://www.slideshare.net 8
http://www.civicactions.com 4
http://home.civicactions.net 1
http://home-dev.civicactions.net 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

CivicActions Drupal Directory Structure Presentation Transcript

  • 1. The CivicActions Drupal Directory Structure Gregory Heller (@gregoryheller on twitter) CivicActions.com Seattle Drupal User Group (#seadug) May 2009
  • 2. Default Drupal Setup If you download and unzip drupal, usually you will put it in public_html: /public_html/ (drupal core live here) /public_html/sites /public_html/sites/all/modules /public_html/sites/default
  • 3. Default Drupal: Pros/Cons ● Its easy: it comes this ● Core upgrades made way more difficult. ● You don't need to ● sites directory must think about it much be copied and moved ● Works fine for a repeatedly single site
  • 4. CivicActions Directory Structure We run 3 versions of each site: dev, qa, live. All run off the same version of core. Active development takes place on dev (new modules, theme changes first tested there). SVN Tags gets cut and moved to QA for more testing. The tag then is released to Live.
  • 5. CivicActions Directory Structure You don't need to run your setup like this, or use SVN to reap the benefits of the CivicActions Directory Structure.
  • 6. CivicActions Directory Structure What are the benefits? No need to backup drupal core, you can always download it again. Back up all your sites directories easily and at one No need to move your sites directory for every core upgrade. Possible to run multiple versions of core for different sites off the “same” multi site.
  • 7. CivicActions Directory Structure Limitations and Drawbacks: Some hosting companies don't let you access anything outside of your web root. Get a new hosting company. Some webhosts have limitations on the number (depth) of symlinks (symlink1 => sym2 =>real_file doesn't work). You can modify the structure a bit while still reaping the benefits.
  • 8. CivicActions Directory Structure These are all real directories (at the same level): /public_html/ /drupal/nobackup/ /drupal/nobackup/6.11 /sites/ /sites/all /sites/example.com
  • 9. CivicActions SymLinks Symlinks (short for “symbolic links”) are your friend. They're like “shortcuts”. Create them with the following command: $ ln -s target/directory symlink See where they point with: $ ls -la where “target/directory” is the directory or file you want to link to, and “symlink” is the link
  • 10. CivicActions SymLinks Structure /public_html/example.com => ../drupal/nobackup/6 this symlink sends apache requests from your public_html directory to drupal/nobackup/6 /drupal/nobackup/6 => 6.11 (/drupal/nobackup.6.11) this symlink sends requests from “6” to “6.10” allowing you to easily switch to a new version of drupal core /drupal/nobackup/6.11/sites => ../../../sites this symlink points to a sites directory outside of drupal core, which means you don't have to move the “sites” directory each time you upgrade core, and also makes it easier to backup sites (your contrib modules and files)
  • 11. What does your Sites Directory Look Like? This is no different from a “standard” multisite setup. Drupal “knows” which site to serve up based on the apache referral. All sites can access the modules and themes in the /sites/all directory. Notice there is no “default” directory! /sites/all /sites/all/modules/contrib /sites/all/modules/custom /sites/example.com /sites/example.com/modules/contrib /sites/example-two.com /sites/example-two.com/modules/contrib
  • 12. Advanced Tricks: Staging Sites Sometimes you will have a staging site like drupal.example.com because your client is not ready to launch. In your sites directory you can symlink drupal.example.com => example.com When the time comes to launch the site, all you need to do is point the final domain at your drupal core install (which means, at the symlink in public_html that points to drupal/nobackup/6)
  • 13. Recap apache request for example.com goes to public_html/example.com which symlinks to ../drupal/nobackup/6 which symlinks to drupal/nobackup/6.11 Drupal looks in /sites which symlinks to ../../../sites for example.com and finds it, and settings.php which points to the right database, and all the modules and themes live in that directory (/sites/example.com or /sites/all).