Multi-site on Linux
Posted by drupallovers on February 28, 2012
- Drupal 6
- Apache 1.3
- Red Hat 6.1 (Although other distributions will work)
- PostgreSQL 7.4
(You may get more specific explanation in your Linux distribution documentation.https://help.ubuntu.com/community/Drupal
- Install the Drupal core download from Drupal.org.
- Install default Drupal site. I created mine with a “dummyUSER” user and “dummyDB” database with Drupal code in apache/htdocs/drupal
- Once you have this working then create a new dir “example1.com” directly under “sites” dir.
cp -R sites/default/* sites/example1.com/
- Create a new database “example1DB” and new user “example1USER” in database.
- Edit the sites/example1.com/settings.php and change the following:
$db_url = 'pgsql://dummyUSER:dummyPSSWDl@localhost/dummyDB';
$db_url = 'pgsql://example1USER:example1PSSWDl@localhost/example1DB';
- (this step is optional, normally Drupal will recognise the base url automatically):
# $base_url = 'http://www.example.com';
$base_url = 'http://www.example1.com';(Remove the ‘#’ [comment])
cp apache/htdocs/drupal/install.php to apache/htdocs/drupal/sites/example1.com/
- Point your browser to www.example1.com. Drupal will show you lot of errors.
- Once it shows you errors you are all good. Just point your browser towww.example1.com/install.php and it will present you the installation screen. Install from there on.
- Repeat the above process for www.example2.com
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.