Wednesday, February 23, 2011

Installing Drupal on Windows

The best way to familiarize oneself with Drupal is to play around with a local deployment.
For those who are unfamiliar with client-server model, here is what a local deployment means.
Others can skip to installation directions.
  • Install a server in your machine locally. This means, only systems, which are connected to your machine in LAN, can access the website.
  • Install a Drupal application in the local server. Typically one server can have multiple instances of applications. By applications, I mean, different websites, which can be of different flavors like Drupal, Joomla or CodeIgniter.
  • Once you are ready to take your site online, deploy your application on a public server.
  • A public server can be obtained by buying it, or getting a static IP for your machine from your ISP.



Installation
    Drupal uses MySql and PHP, so I have chosen AMP package.
    Generally term AMP is used to mean Apache, MySql and PHP.
    There are bundled packages which install the above three and set up a server in 1 click.

    Depending on OS there are different flavors of AMP
    • LAMP for linux
    • WAMP, XAMPP (includes Perl), etc for Windows
    • MAMP for  Mac OS 

    Windows
         Part I: Setting up server and database
    1. Download latest version of Wamp server from here. Choose according to your system bit size, generally 32 bits.
    2. Install Wamp server from the downloaded exe. Check the box to add "Quick Launch icon" during installation. This will put an icon looking like a "W" on your taskbar.
    3. Click on "W" icon in task bar. You'll see a list of menus. If your server is not already online, you'll see an item saying "Put Online". Click it to put your server online.
    4. Test to check if your server works. Open a browser and type the url http://localhost/ ( or click on Wamp and select localhost) and you should see the welcome page of Wamp.
    5. Create a database for drupal to work. Select phpMyAdmin from Wamp menu. This will open a page in a browser and you will see a page to create a database.
    6. Enter the name of the database, <dbname>, under Create new database and click Create. Keep all other settings intact. For me, <dbname> is db_for_drupal.
    7. Go to Wamp Menu > Apache > Apache modules and make sure the rewrite_module is selected. I'll explain its purpose later when we get to know drupal for those who do not know.
         Part II: Setting up Drupal
    1. Download Drupal 6.20 from here. Click on file drupal-6.20.zip. Though the latest Drupal version is 7.x, a lot of modules and themes are still supporting 6.x. You can always upgrade to 7.x when you feel the need.
    2. Click www directory from Wamp menu. This is the folder where your applications will be put
    3. Unzip the drupal file drupal-6.20.zip and place in under www directory. Rename the folder to your website name. Your site will be accessible in the url path http://localhost/<sitename>. E.g, if my site name is dfordrupal then my url will be http://localhost/dfordrupal. Henceforth, I will refer to your drupal directory under www as appfolder and http://localhost/<sitename> as siteurl.
    4. Go to your appfolder. Go to sites folder and then to default folder. Create a copy of file default.settings.php and rename it to settings.php. This file is required for drupal installation.
    5. Go to your siteurl. You will see a page asking you to Choose language. Select the first option for English.
    6. For database name enter your <dbname>. Username will be root and password is blank. This is because these were the default values when we created a database using phpMyAdmin. Click Save and continue.
    7. Enter <sitename> and details for admin username and password. If you see that Clean URL's are selected then the settings are alright. Don't worry for now, if they are not. I'll tell you later about how to enable Clean Url. Click Save and continue.
    8. You may see warnings but ignore them and click your new site.
    9. You are now looking at your home page. From now on, your siteurl will bring you to this page.
    Now that your drupal installation is done, we will find how to customize and extend it in subsequent posts. 
    You can also refer to this video tutorial by Learn By The Drop to visualize the steps.

    Installing drupal in other platforms is similar to the one described above. Only Part I will be different depending on the AMP Package. 
    I'll post similar tutorials for Linux and Mac OS.






    No comments:

    Post a Comment