Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Site installation and introspection

From: Simplified Drupal Sites with Drush

Video: Site installation and introspection

Throughout this course I will be building a Drupal site piece by piece. In this segment I will start by downloading the Drupal core, gathering information about site status then performing a site installation. Throughout this process I'll describe how each command works, and how it relates to everyday operations. Before you begin identify the location of your Web server root that you want to build your site and determine the following about the database, the username and password, database name, and the port that you wish to use for connection settings.

Site installation and introspection

Throughout this course I will be building a Drupal site piece by piece. In this segment I will start by downloading the Drupal core, gathering information about site status then performing a site installation. Throughout this process I'll describe how each command works, and how it relates to everyday operations. Before you begin identify the location of your Web server root that you want to build your site and determine the following about the database, the username and password, database name, and the port that you wish to use for connection settings.

I'll start by opening a command line, connecting to my sandbox, and navigating to the Web server root where I will start the base installation, cd /media/sf_sandbox. I'll list the content to the directory to ensure that there are no files on it, ls - la. If you type drush help, you will see a comprehensive list of all commands that drush is aware of. To get help on any command type 'drush help' then the name of the command.

The first command I will demonstrate is pm-download, which stands for Project Manager download. Project Manager is a group of commands within Drush that allows you to download, manipulate, and analyze the Drupal extensions both modules and themes. While I can type the entire command there is a shorthand alias, dl; that I will use to save time. Drush will display high-level information about the command, followed by examples, arguments, options, and finally any aliases.

The first of the examples is the commands that I will be using, downloading the latest recommended release of Drupal core. The only argument that the Project Manager Download command takes is a comma separated list of projects to download, which in this case is the Drupal core itself, drush dl and then the project name drupal. As there is no site installed Drush will just default to downloading Drupal and extracting the contents into a directory named Drupal 7.17 which is as of this writing the current version. Once Drupal core is downloaded Drush will be aware of the context, and will not append to the project version to any downloaded modules or themes.

I see a success message describing what happened, followed by a summary of everything that was in the downloaded project. In this case 3 profiles, 4 themes, and 47 modules. I can also manually specify a particular release by version using drush dl Drupal 7.x, which will download the latest version of Drupal 7 now 7.15; we'll expressively download Drupal 7.15. Perform a directory listing to see what changes were made.

There is one directory Drupal 7.17 as described in the status message. Drush keeps all the temporary files and results of its operations out of the site root, which helps keep the workplace clean. Change directory to Drupal 7.17 then list the directory contents. All of the contents that Drupal project have been extracted which is exactly what I wanted. Let's get some introspection into Drupal, the command core status aliased as just status, so 'drush help status' provides a bird's eye view of the current Drupal installation.

I'll show the help on the core status command. There not nearly as many options for this Command, but it doesn't mean that it is not helpful. For now I just want to get the status report, drush status. The Drupal version Default and Administrative theme, PHP configuration, Drush version and configuration, and Drupal root are displayed. This is incredibly helpful for giving context when asked to help out with another site. When a Drupal site is installed this site will give connection information as well.

The next command I will demonstrate is site-install aliased as si, drush help si. Site Install is a powerful tool allowing an administrator to complete the install a site using a given installation profile with a single command, rather than slogging through pages of configurations. It also creates the first user UID1 and randomly generates a password for the user displaying the result. There are also a large number of options for the site-install command.

In its simplest form site-install will use the database configuration that was specified in settings.php, but as this is as freshly downloaded installation that information is missing. So if I just do drush si, Drush rightfully complaints that there is no database connection so I will need to specify it using drush si --db-url=. This is only required for the initial install not reinstalls. The DB URL is specified using the Drupal 6 database URL for conciseness and will generate the regular array structure automatically.

I'm using a MySQL database connection with a username and password root. I'm going to put it on the localhost at 127.0.0.1, on port 3306. That's the default port using the database Drush. Your connection settings may be slightly different than the ones I'm using, please adjust them to reflect your working environment. Before I perform the command I'm going to specify one more option the password of the admin user, so I don't have to keep track of the randomly generated password.

This is fine for a development environment but avoid doing this in a production context. --account-pass=admin, press Enter and Drush will install the site, but first it will prompt to you about what it's about to do. Create the database tables which include dumping any existing database tables. So it wants to be sure that this is what should be performed. I am sure so I'll just say y for yes. A few moments later an installation is complete and the admin password is displayed for my records.

I'll switch to my browser and navigate to where my site is installed which in my case is http://sandbox.dev:8080/ drupal-7.17, Welcome to Site-Install. This site has been installed using the standard Drupal installation profile. Login using the username and password, admin, admin, to verify everything is working properly. Switch back to the terminal.

Now that the site is installed drush status is going to be a lot more helpful. In addition to the status information shown before the site URL database connection information, ability for Drupal to bootstrap, site and file paths are displayed. Now that the site has been installed and I have some perspective into the site I'm going to start managing the modules including listing, searching, enabling, and disabling modules.

Show transcript

This video is part of

Image for Simplified Drupal Sites with Drush
Simplified Drupal Sites with Drush

18 video lessons · 4130 viewers

Jon Peck
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Simplified Drupal Sites with Drush.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.