How to Install Drupal, Beyond the Manual

October 12th, 2011 • Tags: drupal, drupal installation, drupal setup, how to install drupal

How to Install Drupal, Beyond the Manual

cPanel makes it dead simple to install a CMS, particularly Drupal. Even if Fantastico is not available, chances are your hosting service has a home-brew solution that can turn-key Drupal. This guide is intended to go beyond the normal manual.

First, the non turn-key solution. This has been documented a dozen times, so I’ll run quickly through it. This is actually the recommended way to install Drupal or any CMS. The turn-key solution may be using an outdated package. Downloading and installing directly guarantees that you will always have the latest.

  1. Download the latest Drupal:
    http://drupal.org/project/drupal 
  2. If you are using a Linux-based host (very likely), I always recommend the tar.gz file. tar + gzip preserves file characteristics discarded by ZIP.
  3. Extract in your preferred directory, probably web root (public_html).
    #: tar -xvzf drupal-7.8.tar.gz
  4. It will extract in to the directory “drupal-7.8”. If you would like it in your root folder, you can do:
    #: mv drupal-7.8/* .#: rm -r drupal-7.8/

    Note that cPanel file manager is capable of extracting this file for you.

  5. Set up the MySQL / PostgreSQL database.
    What Drupal needs is a database name, database user, and database user password. cPanel and Plesk have a database wizard to help you. By convention, the database name and user are usually the same. NEVER use your master account credentials for your databases!

  6. Next, you need to go to the install directory (just going to the web root wil redirect you) and fill in the info to Drupal. Fill in all the details. This has been documented many times too. The only really advanced piece may be choosing the table prefix, so I will describe that.

    The table prefix is simply used to keep drupal tables from clobbering other tables you may have in your database. If you just created a brand new database using the cPanel / Plesk wizard, you don’t need to worry about this. If you are sharing an existing database with Drupal, use the table prefix to keep them separate.

  7. Now, you need to fill in your basic details. Anything here can be changed later:

     

If all goes well, your web site will look like this. This is the default Drupal install:

Now that we have Drupal running, it is time to go beyond the manual. Nobody uses the vanilla Drupal installation. Not that there is anything wrong with the default, but you can do so much more with a few extra tricks.

The first and obvious problem is nothing on the front page. The default no-front-page-content quirk has plagued Drupal admins for a long time (particularly in Drupal 6 when they never said what was wrong). Go ahead and give your customer something to look at:

  1. Go to Add Content –> Basic page.
  2. Punch in some filler content.
  3. Go to publishing options.
  4. Promote to front page.

Now, we need to pick a theme. Drupal made Bartik its default theme in Drupal 7. This is a big step up from Garland before. However, it is still pretty bland. Go to Appearance -> Themes and pick a new one. I won’t go in to detail because this has been covered many times. But just as a strategy tip, I prefer to pick a full-featured theme and scale it back rather than picking a base theme to scale up. A couple of good ones to glance at are Danland and Pixture Reloaded.

Quick tip: If you cannot install a new theme, check that “Update Manager” module is enabled.

After you have a theme, you may want to remove or rearrange some things. This can be done in the
(your drupal install directory) sites\all\themes\(theme name)

Look at the PHP files, such as page.tpl.php and node.tpl.php

While you are there, now is a good time to add Google Analytics (google.com/analytics). While you are digging in the theme code, find the end and paste your GA code you got from Google.

We are doing pretty well now. Our theme is swapped for something better, and we have Google Analytics going. However, our site is still missing some critical elements. For that we go to Modules. (Modules are to Drupal as Plugins are to WordPress). Drupal 7 core already includes many must-have modules, such as CCK, that were missing from Drupal 6. However, we need a few more.

The must-have Drupal 7 modules are:

  1. Views (which also requires CTools)
  2. Pathauto
  3. Wysiwyg (with CKEditor)

Views allow significantly more flexibility in presenting content to users. I often use it to create a /news page with a News RSS feed and then a dynamic News block on the front page. Views allows this capability. Look it up for more information as it gets complex quick as it is pretty powerful. There are lots of good tutorials.

Pathauto generates SEO-friendly paths for all your content without you needing to do it yourself. It just saves a couple extra clicks. Without it, your content could end up looking like  /node/23

Wysiwyg + CKEditor gives your users a nice rich-text editor. Any contributor that is not familiar with HTML markup will be very thankful. Drupal’s default editor is pretty weak.

We are finished downloading and installing things, but our site still needs more tweaking before giving it to a client…

One of the biggest complaints/requests is uploading files to the site to be used in pages / articles. It is simply not obvious how to do this in Drupal. Therefore, I go to the built-in content types (Page and Article), and recently created  News, and I add a file field:

  1. Go to admin/structure/types
  2. Go to “manage fields”
  3. Add the File field and type.

    You need to determine what file extensions are allowed. I wish there was an “all” for this, but there isn’t, so go ahead and paste this big string of extensions in there:

    bmp, png, jpg, jpeg, gif, txt, zip, dmg, pdf, doc, docx, xls, xlsx, mp3, ogg, flv, msi, odf, odt

    That will cover you for most cases.

  4. Hide this field in the teaser and show it as a table in the full page. That is probably how your client will want it. He/She  will be very thankful to have a convenient way to upload files to posts.

Drupal is now running a lot better than it would’ve been without these extra steps. Go ahead and hand it off.

 One last tip before closing out: There is an often overlook, but very useful distribution of Drupal called “Acquia Drupal”. This is made by the maintainers of Drupal and can be downloaded for free here:

http://acquia.com/downloads

By starting with Acquia Drupal, you get pathauto, CTools, and other useful modules bundled and ready to go saving you some time. It also comes with the spam-stopping service called Mollom (http://mollom.com) installed and ready to be configured. If your site is heavy on user-submitted content, this may be useful to you.

0 responses so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment




Webmaster Resources: Web Hosting Blog
© Copyright 2012 - TheWebHostingHero.com
Follow us on Twitter Facebook Subscribe to our RSS Feed