2009年3月3日 星期二

Drupal 6.X Multi-Site Howto

步驟如下:

Multi-site on Linux

Last modified: January 3, 2009 - 22:09

Software installed:

  • Drupal 6
  • Apache 1.3
  • Red Hat 6.1 (Although other distributions will work)
  • PHP5
  • PostgreSQL 7.4

The process:

  1. Install the Drupal core download from Drupal.org.
  2. Install default Drupal site. I created mine with a "dummyUSER" user and "dummyDB" database with Drupal code in apache/htdocs/drupal
  3. Once you have this working then create a new dir "example1.com" directly under "sites" dir.
    mkdir sites/example1.com
    cp -R sites/default/* sites/example1.com/
  4. Create a new database "example1DB" and new user "example1USER" in database.
  5. Edit the sites/example1.com/settings.php and change the following:
    • $db_url = 'pgsql://dummyUSER:dummyPSSWDl@localhost/dummyDB';
      to $db_url = 'pgsql://example1USER:example1PSSWDl@localhost/example1DB';
    • # $base_url = 'http://www.example.com';
      to $base_url = 'http://www.example1.com'; (Remove the '#' [comment])
  6. cp apache/htdocs/drupal/install.php to apache/htdocs/drupal/sites/example1.com/
  7. Point your browser to www.example1.com. Drupal will show you lot of errors.
  8. Once it shows you errors you are all good. Just point your browser to www.example1.com/install.php and it will present you the installation screen. Install from there on.
  9. Repeat the above process for www.example2.com

Note
If it says the site is offline then your database information in settings.php is not correct. If it says site not found then your base url in settings.php is not correct.

沒有留言: