Drupal is used to build Web sites. It's a highly modular, open source Web content management framework with an emphasis on collaboration. It is extensible, standards-compliant, and strives for clean code and a small footprint. Drupal ships with basic core functionality, and additional functionality is gained by the installation of modules. Drupal is designed to be customized, but customization is done by overriding the core or by adding modules, not by modifying the code in the core. It also successfully separates content management from content presentation.
Drupal can be used to build an Internet portal; a personal, departmental, or corporate Web site; an e-commerce site; a resource directory; an online newspaper; an image gallery; and an intranet, to mention only a few. It can even be used to teach a distance-learning course. A dedicated security team strives to keep Drupal secure by responding to threats and issuing security updates. And a thriving online community of users, site administrators, designers, and Web developers work hard to continually improve the software.
Drupal's design goals include both being able to run well on inexpensive Web hosting accounts and being able to scale up to massive distributed sites. The former goal means using the most popular technology, and the latter means careful, tight coding. Drupal's technology stack is illustrated in Figure 1-1.
Figure 1-1: Drupal's technology stack.
The operating system is at such a low level in the stack that Drupal does not care much about it. Drupal runs successfully on any operating system that supports PHP.
The Web server most widely used with Drupal is Apache, though other Web servers (including Microsoft IIS) may be used. Because of Drupal's long history with Apache, Drupal ships with .htaccess files in its root that secure the Drupal installation (if you're using a Web server other than Apache, be sure to convert the .HTaccess rules to the syntax understood by your system). Clean URLs -- that is, those devoid of question marks, ampersands, or other strange characters_ are achieved using Apache's mod_rewrite component. This is particularly important because when migrating from another content management system or from static files, the URLs of the content need not change, and unchanging URIs are cool, according to Tim Berners-Lee.
Drupal interfaces with the next layer of the stack (the database) through a lightweight database abstraction layer. This layer handles sanitation of SQL queries and makes it possible to use different vendors' databases without refactoring your code. The most widely tested databases are MySQL and PostgreSQL.
Drupal is written in PHP. PHP has gotten a bad reputation, because it is easy to learn so much PHP code is written by beginners. Like many programming languages, PHP is often abused or used to quickly hack systems together. However, PHP can also be used to write solid code. All core Drupal code adheres to strict coding standards.
A lightweight framework makes up the Drupal core. This is what you get when you download Drupal. The core is responsible for providing the basic functionality that will be used to support other parts of the system.
The core includes code that allows the Drupal system to bootstrap when it receives a request, a library of common functions frequently used with Drupal, and modules that provide basic functionality like user management, taxonomy, and templating, as shown in Figure 1-2.
Figure 1-2: An overview of the Drupal core (Not all core functionality is shown.)
The administrative interface in Drupal is tightly integrated with the rest of the site and, by default, uses the same theme. The first user, user 1, is the superuser with complete access to the site. After logging in as user 1, you'll see an Administer link within your user block. Click that, and you're inside the Drupal administrative interface. Each user's block will contain different links depending on their access levels for the site.