Getting started with Drupal
In this book, we will jump straight into using Drupal to build a practical website, and not spend a lot of time talking about basic functionalities, the design of Drupal, or theoretical aspects related to Drupal. We will use Drupal 7, the most recent active version of Drupal, throughout this book. Drupal 7 is continuously in development, while Drupal 6 is also still supported and available for use on sites. The roadmap for Drupal already shows that Drupal 8 is in the planning stages.
To start using Drupal, we recommend setting up a development environment on your local desktop (either on your PC or on your Mac). You can develop the website for the client on your local computer using a local server, powered by MAMP (MySQL, Apache, and PHP for Mac) or WAMP (the same for Windows). This allows for quick and robust local development. When you're ready to show the client the site, you can easily transfer the Drupal site files and the database over to the client's web host.
You can also install the Drupal Development Desktop Stack that Acquia provides for download. They call this the Dev Desktop (http://www.acquia.com/products-services/dev-desktop), and it packages the entire Drupal core with PHP, MySQL, and an Apache web server.
This section will assume you have chosen either MAMP or WAMP to install on your local computer. We'll be installing Drupal into the web root of your local environment, which is usually htdocs
or www
.
You're also going to need to set up a database for your Drupal 7 site to use, since Drupal is database-driven. To do this, navigate to your localhostphpMyAdmin application. In MAMP or WAMP, this is easily located through the MAMP or WAMP control panel.
Follow the given instructions for setting up your database:
Open phpMyAdmin and click on the Privileges tab.
Click on Add a new User:
Type in a User name (here I'll enter the username drupal7); set Host to localhost; and type in a password. Re-type the password.
Select the Create database with same name and grant all privileges radio button.
Then click on the Check All link.
Click on the Go button, to create the database:
Jot down the credentials from above, as you'll need them when you install Drupal.
Your blank database is now created and you can now move on to installing Drupal.
You can use the following steps to install Drupal:
Navigate to http://drupal.org, through your web browser. Click on the Get Started with Drupal button.
On the next page, click on the Download Drupal 7.8 button. This will launch a Download & Extend page. You want to download the 7.x version of Drupal, so click on the
tar.gz
download link to start the download. Save thetar.gz
file to your web root directory. At the time of this book's release, the Drupal version is 7.8. It may be a different 7.x version when you go to download it.After you download the Drupal installation, you will need to unpack it. The installation is delivered in
tar.gz
format, to unpack which you may need a specialized tool, such as 7-Zip or WinZip. 7-Zip is a freely-available program designed to work with a wide variety of compressed file formats. On the Mac, you should be able to unzip the file by default, without having to download any tools.Unzip/unpack the
tar.gz
file in yourhtdocs
orwww
folder. The resulting unzipped folder will be calleddrupal-7.8
, by default. This is your Drupal site folder.You can rename the
drupal-7.8
folder to be more specific to the site you're building. Let's rename the folderartisanbakers
.You can now browse to the location where you have installed Drupal in a web browser, to begin the installation process. If you are installing on your localhost environment the URL of the install will be something similar to
http://localhost/artisanbakers/install.php
. You should see a screen similar to the following screenshot, asking you to Select an installation profile.Leave the installation profile Standard selected, and then click on the Save and Continue button:
Leave English set as the default language and click on Save and continue:
The next screen will ask you to add your MySQL database credentials for the database you originally created for the site. First, make sure to leave the MySQL, MariaDB, or equivalent radio button selected. Now, add your credentials, including Database name, Database username, and Database password, here. Once you add the credentials, click on Save and continue.
There may be a case where you need to add Advanced Options for your database connection. If you are going to be installing and hosting the database on an external server you'll want to expand this Advanced Options fieldset and add the path to the externally-hosted server. In our case, we're hosting the database on the same localhost server, so we do not need to expand this fieldset now:
Drupal will now proceed with the install.
The Configure site screen will load next. This screen is split up into various fieldsets. First, you want to give your site a Site name and Site e-mail address. The site name can be Artisan Bakers Collective. For the site e-mail address, type in your e-mail address, for now:
Now, you need to set up the Site Maintenance Account. This first user account on the site is the super-user administration account. You'll use this account to do all the site development and, later, to maintain the site. For now let's call the super user "admin", so type in
admin
as the username. You can use the same e-mail address you used previously. Add a password.The password should be strong and include special characters, such as, # or @. You may also want to use capital letters mixed with lowercase ones and also add numbers to the password. Drupal will check the password, using the password strength visual prompt, and this will assist you in constructing a strong password. This is essential for keeping your site secure.
For Server Settings, choose the Default country and Default time zone for where you are located. This will automatically use the time zone of your country for all date- and time-related functionalities on your website.
Lastly, leave the checkbox next to Update Notifications ticked, to check for updates automatically and receive e-mail notifications.
Click on Save and continue.
The installation will complete and you'll see a congratulations screen. Click on the Visit your new site link, to launch your Drupal 7 website: