Drupal 6 - Installation
This is the first part of the series of tutorials that I am going to write on how to work with Drupal. I was going to write a series of tutorials of how to code a PHP website from scratch and then decided that this is much more useful for the general public as developing with Drupal is much quicker and the base of the website (the framework) is already set up for you. People who don't know PHP yet will be able to learn what they need to work with Drupal, which is more then enough to go out and build a custom website down the road if your really feel like it.
If you are planning on developing on a Windows machine you will need some sort of virtual server set up to run Apache and MySQL. Some things you could use are EasyPHP or WAMP (just two of many out there). I used to use EasyPHP and liked it better then most other things out there, but its really up to you and your preferences on what you would rather use to develop with. Here is a tutorial for configuring (and troubleshooting haha) it on your Windows.
If you are using a Linux machine it will be easier for you to achieve what you need to do to get Apache and all other things running. If you are unsure on what you need to do, you can follow this guide (lots of other guides out there for this). For a Mac I'm pretty sure the procedure will be along the same lines.
First step we need to do is install the Drupal 6 clean installation to begin developing. The first step to doing this is navigating to the Drupal community plumbing website here. When you first arrive at the front page of Drupal.org you have to navigate to Drupal 6.XX (in this case 6.15).

When you have downloaded the archive you will need to unzip it. I use 7zip to unzip tar.gz archives. People who are using Linux and Mac should have no problems opening these with what they already have on their machine.

The default root directory of Drupal consists of several sub-directories and files in the main directory. Which should look like this when you first open up the archive. The next step after this is obviously to extract the files to a directory, which I will cover in the next step.

Now we have to extract the files into a directory (where ever you configured your Apache). In my case I have a local server that is running Linux so I will just extract the Drupal site into my /var/www/ directory. If you are using EasyPHP it has to go into Program Files\EasyPHP\www directory.

We have now successfully extracted the default Drupal website into our /var/www/samplewebsite directory. Usually at this point I like to clean up the Drupal website and get rid of "unnecessary" files. To start doing this, I remove all of the the .txt extension files (ones in capitals) from the directory (leave robots.txt alone in the dir!). If you are wondering what those files are for, most of the time files in capitals in Drupal are information purpose files - if you want to know more, read them. Here is a pic of the files I remove:

After removing those files I navigate into the /themes directory that is located in the root. There I remove the themes that I know I will not be using for this website, just so the website becomes even more slim. The directories I usually remove are seen in the next picture. You must leave the engines and garland direcotires at all times in this folder. (engines directory handles the templating of you website with all of the themes, and garland is a theme that your site should always have for servicing it and just in general as a backup theme)

After you have cleaned up this directory, you can begin setting up the settings for your Drupal website. You must navigate to /sites/default where you will find one file named default.settings.php. This file houses all of the settings for configuring a connection to your database (and a few more other settings - you can read over the comments in the file to see what all of the others do). We must copy this file and rename it to settings.php (be sure to leave the default file unchanged!!). At this time you can also make the /files directory inside of the default directory. When you are done you default folder should look like this:

Inside of the settings.php file, find the the following line of code (see image below). This is the line that is used to make a connection to your database, and it looks like this:
<?php
$db_url = 'mysql://username:password@localhost/databasename';
?>What we need to do with this line of code is configure it how we plan to name settings for our database. The user name part, usually when you are developing on a local server will be 'root', the password is whatever you have it assigned as for that user. If you do not have a password assigned you can change it within your PHPMyAdmin under "Privileges" tab. The 'localhost' portion usually stays as localhost for most part (depending on your hosting provider). The 'databasename' portion will be the database name that you are going to make for this website. When you are done with this string, it should look something like this:
<?php
$db_url = 'mysql://root:mypassword@localhost/sample_website';
?>After this save this file and exit your text editor/IDE. What we need to do next is create the database according to the string we just ajusted in our settings.php file. Open up a browser and navigate to your PHPMyAdmin (depending on your installation this will be different). If you are running EasyPHP you can navigate to http://127.0.0.1/home/mysql/. Other virtual servers will be something similar to this, if you are unsure read up on it for the particular server / virtual server set up you are running. When you are inside of PHPMyAdmin navigate to the create database area and create a database that corresponds to the settings you set inside of you $db_url variable.

If all was done correctly to this point you should be able to navigate to your website through your browser (if using EasyPHP you can navigate to
http://127.0.0.1/drupal_site/install.php) to begin the installation of Drupal; other types of server installations will require you to navigate to the website using a different URL. If you are having any problems with permissions after navigating to your new website at any point during your install, please consider reading on how to work with permissions here. This is what your website should look like at this point if everything was done correctly:

When you click "Install Drupal in English", the setup will take you to the next step. Almost 90% of the time you will get the following message afterwards. This is what you probably have on your screen now:

If you are running a Mac or Linux machine to fix this problem is a little simpler then on a Windows machine. If you have access to a terminal on your Linux based computer, you can navigate to the /sites/default directory and run the chmod -R 777 files/ command. If you are however on a Windows computer, you can do it by going to right click and properties. If you successfully changed the permissions of the files/ direcotory, after you refresh the page (F5) your installation should begin. This is what the next screen looks like if you succeeded here:

The next screen is one of the last before you finish your first Drupal installation! On this screen enter your information as you see fit. Make sure that your settings.php and default.settings.php files have been set to read only for security at this step too!

After you are done entering the info, at the bottom of this form you will see an option for 'Clean URLs'. I highly suggest enabling this option (if unable to enable it because your server doesn't support it, there a lot of tutorials on how to enable it on Apache config files). See image below:


You have officially finished installing your first Drupal website! Congrats. If you have any suggestions on where I should go more indepth, please comment or email me!
