Setting up a Drupal 5 site from scratch

13-Nov-2007
Filed under: Drupal, Drupal 5.x

The following guide is a representation of the steps I usually take when starting development on a new Drupal based website. It is what I consider to be "best practice", but some of it is quite prescriptive and therefore may not suit your needs. Feel free to pick and choose the steps to take as you see fit.

  1. Create a directory in your server's web root, and optionally create a virtual host to point to this directory.
  2. Download the latest stable release of Drupal 5 from http://drupal.org/download and extract it to the directory you created in Step 1.
  3. Create a new MySQL database and MySQL user:
    CREATE databasename;

    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE
    TEMPORARY TABLES, LOCK TABLES
    ON databasename.*
    TO 'username'@'localhost' IDENTIFIED BY 'password';
  4. Depending on your version of MySQL, you may have to update the password you specified above to allow web scripts to connect to it. First, connect to the mysql database:
    USE mysql;
    Then execute the following query:
    UPDATE user SET password = OLD_PASSWORD('password') WHERE user = 'username';
  5. To activate the new permissions, enter the following command:
    FLUSH PRIVILEGES;
  6. Go to the sites/default subdirectory of your new Drupal directory and change the permissions of settings.php so that the Drupal install will be able to write to it:
    chmod 777 settings.php
  7. Go to http://your-drupal-url.com/install.php in your web browser, and enter your database connection details. Save the configuration.
  8. Now, for security purposes, set the permissions on settings.php to soemthing a little more restrictive:
    chmod 644 settings.php
  9. Back in the web browser, click go to your new home page, then click the 'create the first account' link. This allows you to create the super administrator account (which has an ID in the database user table of 1). Always name this account 'admin'. Specify your email address and create the account.
  10. On the next page, specify a new password for the account, set the time zone and click 'Submit'.
  11. Create two subdirectories in the sites/all subdirectory of your drupal installation directory:
    mkdir themes
    mkdir modules
    This is where you'll store your custom themes and modules.
  12. Copy Drupal's Garland theme from /themes to /sites/all/themes. Rename the copied theme directory to something resembling your site name.
  13. Back in your Drupal site, click 'Administer' and go to 'Themes' under 'Site Building'.
  14. Enable the new theme you created above. Save the configuration.
  15. Set your new theme as the default and save the configuration.
  16. Create two folders in the site root:
    mkdir files
    mkdir tmp
  17. The folders need to be writeable by Drupal:
    chmod 777 tmp
    chmod 777 files
  18. Back in the Drupal site, go to the Administer > Logs > Status report and click the 'run cron manually' link. No errors should be reported here.
  19. Go to Administer > Site configuration > Site information and change the 'Name' field to the name of the site, and change the email address to no-reply@your-drupal-url.com or something else. Once you've created a front page, you can set the URL for it in the 'Default front page' field. Save the configuration.
  20. Go to Administer > Site configuration > Input formats and change the default to 'Full HTML' and save.
  21. Once saved, click 'configure' alongside the 'Full HTML' option. Untick 'Line break converter' and 'URL filter' and save.
  22. Go to Administer > Site configuration > File system. Change the value of 'Temporary directory' to 'tmp' (from '/tmp'). Save the changes. This will make your temporary directory relative to your own site.
  23. Go to Administer > Site configuration > Date and time. Set 'Configurable time zones' to 'Disabled' and save. Skip this step if you plan to use time zones.
  24. Go to Administer > Site configuration > Clean URLs. Click 'Run the clean URL test'. If this is successful (it should be unless your .htaccess is being (partially) ignored), select 'Enabled' and save.
  25. Go to Administer > Site configuration > Administration theme. Set your administration theme to 'garland' (or any other theme of your choice -- though perhaps best if it's not the same as the site theme) and save.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Comment spam will be deleted.

This includes any comment posted here for the sole purpose of increasing your page rank. You're wasting my time and your own.