Blog

How to install Drupal

DroppyI’ve started playing around with the Drupal content management system, a piece of software like Wordpress or Blogger that helps you manage your web site. It’s a whole lot more complicated than Wordpress, which KvC is built on, but it’s also a whole lot more powerful. I’m not quite sure what I’m doing yet, but the first step in playing around with any new piece of software is figuring out how to install it.

Installing Drupal was actually a whole lot easier than all the reams of confusing online documentation would have you think.

1. Decide Where to install Drupal
You can install Drupal either in the root directory (http://www.whatever.com), or a subdirectory (http://www.whatever.com/subdirectory). Since this Wordpress site is already installed in the root directory, I decided to install Drupal into http://www.kenvsthecity.com/drupal.

2. Download Drupal
Go ahead and download Drupal. The most recent version is 4.7.2. Drupal is compressed in a wierd archive called a Tarball. Don’t worry. You can unzip it using just about any decompression software. I recommend IZArc.

Download Drupal

Drupal is actually compressed twice for some reason. So just unzip the first file, and then unzip the file you just unzipped. (I hope that makes sense.) Make sure Drupal is nice and cozy somewhere on your hard drive.

3. Create A Home for Drupal
Now it’s time to make a home for Drupal on your web server. Fire up your FTP browser (I recommend SmartFTP) and log in to your web site. Go to your site’s root directory (usually “public_html”) and create the subdirectory where Drupal will live. I named mine “drupal,” since I’m just playing around with it and it doesn’t need some gimmicky URL.

Drupal Directory

4. Create Drupal’s Database
Drupal stores all its data (blog posts, menus, etc.) in a database. You can use either mySQL or PostgreSQL. My webhost has both installed, but I decided to use mySQL. Wordpress also uses mySQL, so I already had a general idea of how to connect Drupal to a new mySQL database.

mySQL

4a. Add database. Most webhosts like mine have a graphical front-end to their site called cpanel. Just click on the mySQL icon. Then type in the name for a new database (I called mine “drupaldata”) and click “Add Db.” There’s a way to do all this stuff through the command line, but this is just easier.

new mySQL database

4b. Add user. Add a new user by typing in a new user name and password, and clicking “Add User”

new mySQL user

4c. Add user to database. Select the user you just created in the drop down box under the new database. Make sure “All” privilages is selected and click “Add User to Db”

add user to database

5. Tell Drupal Where It’s being Installed
Go back to the copy of Drupal you saved on your hard drive. Navigate to “\sites\default”. There you should find the file “settings.php”. Go ahead and open it up in a text editor like Notepad or Wordpad.

Scroll down to where it says “$db_url = ‘mysql://username:password@localhost/databasename’.” Replace “username” with the mySQL username you chose, replace “password” with that mySQL user name’s password, and replace “databasename” with the name of the database you created.

$db_url

Now scroll down to where it says “$base_url = ‘http://www.example.com’.” Replace “http://www.example.com” with the URL of the location you’re installing Drupal to. In my case, it was “http://www.kenvsthecity.com/drupal”.

$base_url

Save “Settings.php” and close it.

6. Upload Drupal
Fire up your FTP browser again and upload Drupal into the directory you created.

7. Import the Drupal Database Setup
I’m not sure if this step is necessary or not, but I did it and it works. Go to cpanel again and click the mySQL icon. Scroll down to the bottom and click on the icon for something calles “phpMyAdmin.” It’s a web-based front-end for managing the settings of your mySQL database. Select the Drupal database you created in the drop down box on the left.

phpMyAdmin

Then select “Import” from among the tabs on the top of the main section. Where it says “File to Import,” click “browse” and select the file “database.4.1.mysql”. It should be under “\database” in the copy of Drupal on your hard drive. Then click “Go.”

Import

file to import

8. Create The Drupal Admin Account
Drupal should now be successfully installed on your host’s web server. Fire up your web browser and navigate to your new Drupal installation. It’ll give you an error message if you haven’t edited “settings.php” right. Otherwise, it will prompt you to create a new user account. The first account you create will automatically have all the administration privilages.

The instructions are pretty straightforward. Click “create new account,” enter the user name and an email address. Hit enter. You’ll get an email with the administrator password. Log in to Drupal and you’re ready to start playing around.

Have fun.