The Magic of Drupal #3 – Under the Hood
ronnie.norwood — Sun, 10/02/2011 - 19:05
If you think of your Drupal website as a car, you know that the exterior is the part you can see. But you know that it has be powered some way but you don't see that from the outside. You have to actually raise the hood and look underneath to see the machinery that makes it go.
With this illustration in mind, there are basically two major components that form the foundation of Drupal that are not visible by simply viewing your website - the file structure and the database. The file structure contains the files and folders necessary for your website to function, including all of the modules and themes, while the database is the place where all of the data generated from your website is stored. Below is the folder structure that will ultimately be created once you have finished the setup:
wamp
alias
apps
bin
lang
logs
scripts
tmp
www
drupal-7.8
includes
misc
modules
profiles
scripts
sites
all
modules
themes
default
themes
For the moment, just focus on the files under the www folder, the structure that the Drupal installation creates. A few things to notice here. First, you can see that there are duplicate modules and themes folders. The ones directly under the drupal-7.8 folder contain the core modules and pre-loaded themes, respectively, while the ones under the sites/all folder are designed for the contributed, as well as any custom, modules and themes. Second, inside the default folder is a file called default.settings.php (not shown in the folder structure), that acts as a shell for creating the settings.php file, which includes key database information. Also, you can optionally create a folder named files under the default folder to include documents, images, etc that will be used on your website.
This brief overview was designed to provide you with the concepts that will prepare you for the setup phase, which will be discussed in the next post of the series.
