Quick and dirty Drupal 4.6 on Windows

Often when people hear about Drupal, they want to get things up and running as quickly as possible. Unfortunately, Drupal is not the most friendly package to getting running "out of the box".

While a lot of the installation wrinkles have been smoothed out with the recently released Drupal 5.0, here is my quick guide to getting Drupal 4.6.x installed. I still have a soft spot for this release, since it was a nice mix of features and simplicity. Some may find it useful, if only as a historical reference:

Drupal install
NB: when running commands or editing files, I have placed the type of action to perform in [square brackets]. Normally the context should be self-explanatory -- for example [find] means to find the line with the indicated text and [change to] indicates that you should modify the previously found text as shown.

  1. Download IndigoPerl 2004 or another web package with Apache and PHP. Get the latest version of IndigoPerl from here: http://www.indigostar.com/indigoperl.htm.
  2. To install IndigoPerl, just extract the ZIP file to C:\IndigoPerl and run setup.bat. You should be able to accept all defaults.
  3. Edit the PHP configuration file (should be in C:\IndigoPerl\apache\php\php.ini) and make the following changes:
        [find]
          display_errors = on
        [change to]
          display_errors = off
        [find]
          log_errors = off
        [change to]
          log_errors = on
        [find]
          ;html_errors = off
        [change to]
          html_errors = off
        [find]
          ;error_log = filename
        [change to]
          error_log = C:\IndigoPerl\logs\php-errors.log
        [find]
          SMTP = localhost
        [change to]
          ; host to use when sending mail -- for a local install, use your ISP's mail server, eg:
          SMTP = smtp.host.com
        [find]
          sendmail_from = me@localhost
        [change to]
          ; From e-mail address to use for all outgoing email sent by the PHP mail function
          sendmail_from = webmaster@host.com
    
  4. Download Drupal from http://drupal.org. Extract .tar.gz file into Apache /htdocs or /var/www/html directory. You may need a program like 7-Zip to extract these files.
    (OPTIONAL: You can download additional Drupal modules from http://drupal.org/project/Modules.)
  5. Download MySQL 4.1 Essentials from http://dev.mysql.com/downloads/mysql/4.1.html#Windows.
    Double-click .msi file to install. Select (*) Typical install, and follow the prompts.
  6. Once setup is complete, the Server Instance Configuration Wizard will start. Select the following:
    Next -> (*) Detailed Configuration -> Next
    Select (*) Developer Machine for testing; (*) Server Machine for production -> Next
    (*) Non-Transactional Database only -> Next
    (*) Online Transaction Processing (OLTP) -> Next
    [ ] Enable TCP/IP Networking -> Next
    (*) Best Support for Multilingualism -> Next
    [X] Install as Windows Service [MySQL]
    [X] Launch Automatically -> Next
    [X] Modify Security Settings
    Root password:
    sqlpwd
  7. To initialise the MySQL database for Drupal, start a command prompt. Type:
        [cmd]
          set PATH=%PATH%;C:\Program Files\MySQL\MySQL Server 4.1\bin
          mysqladmin -u root -p create drupal
        [prompt]
          Enter password: sqlpwd
        [cmd]
          mysql -u root -p
        [prompt]
          Enter password: sqlpwd
        [mysql]
          GRANT ALL PRIVILEGES ON drupal.* TO drupal@localhost IDENTIFIED BY 'drupalpwd';
          flush privileges;
          \q
        [cmd]
          c:
          cd "\IndigoPerl\apache\htdocs\database"
    	mysql -u drupal -p drupal < database.mysql
    

    This will take around 20 seconds to upload the default Drupal database.

  8. In the Drupal web directory (eg. /htdocs), edit the Drupal configuration file sites\default\settings.php using an editor compatible with Unix line-endings (eg. NoteTab Light).

    Edit the $db_url line to match the database defined in the previous steps:

         $db_url = "mysql://drupal:drupalpwd@localhost/drupal";
    

    Set $base_url to match the address to your Drupal site (replace localhost with your hostname for a production server):

         $base_url = "http://localhost";
    
  9. Ensure that index.php is set as the default page type in Apache. To do this, edit C:\IndigoPerl\apache\conf\httpd.conf:
          [find]
            DirectoryIndex index.html index.html.var
          [change to]
            DirectoryIndex index.php index.html.var
    
  10. Visit http://localhost/ and see if it works! IMPORTANT: If an error message appears complaining that "client does not support authentication protocol", you need to use an old password style, set in the MySQL admin command line by:
    	[mysql]
     	  SET PASSWORD FOR drupal@localhost = OLD_PASSWORD('drupalpwd');
            flush privileges;
    	  \q
    
  11. Initial setup:

    Click create the first account
    Username: admin
    E-mail: username@domain.com

    A password will be displayed. You will be required to change it on first logon.

  12. Drupal is designed to be highly configurable. To add or remove modules, click administer -> modules from the menu on the left.
  13. Site roles control who can perform what actions on the site. To configure site roles, click administer -> access control -> roles tab.
  14. Site blocks define what information is displayed where on each page. For example, you can configure Drupal to show a list of recent comments, or who is currently logged in to the system. To do this, click administer -> blocks.
  15. Categories allow you to group pages into logical sections. With the "site menu" module, you can create a "tree navigation" structure to browse all articles. Click administer -> categories to manage categories.
  16. Drupal also allows you to easily change the appearance of the site. Click administer -> themes -> list tab to view available themes, or you can download more from the "Themes" section of drupal.org.
  17. Many Drupal tasks require regular updating, such as the indexer used when searching pages. For this to work, the file cron.php must be run on a regular basis. This should be set up either as a cron job (Linux) or Scheduled Task (Windows). If no other arrangement is possible, simply point your browser to http://localhost/cron.php on a regular basis. Loading cron.php also runs all maintenance tasks on your server.