Laos 2009 © Tina Chen
New York City 2010 © Tina Chen
Rwanda 2007 © Tina Chen
Nepal 2008 © Tina Chen
Zambia 2005 © Tina Chen
The Galapagos 2008 © Tina Chen
Sweden 2010 © Tina Chen
Denmark 2010 © Tina Chen
France 2005 © Tina Chen
Nicaragua 2012 © Tina Chen
Costa Rica 2005 © Tina Chen
Germany 2010 © Tina Chen
The Bahamas 2010 © Tina Chen
Cambodia 2009 © Tina Chen
Austria 2009 © Tina Chen
India 2008 © Tina Chen
Tanzania 2007 © Tina Chen
Malaysia 2005 © Tina Chen
Namibia 2005 © Tina Chen
Botswana 2005 © Tina Chen
South Africa 2005 © Tina Chen
Egypt 2005 © Tina Chen
The United Kingdom 2005 © Tina Chen
Vietnam 2004 © Tina Chen
Kenya 2007 © Tina Chen
Canada 2003 © Tina Chen
Thailand 2004 © Tina Chen

How to: Drupal Multisite on Windows Localhost

Goal

Setup test/development environment for Drupal on local Windows computer.

Strategy

Keep original clean Drupal installation, then create many test/client sites, such as:

sites/defaut
sites/site1
sites/site2
sites/dev.mysite.com

If site1 doesn’t work, delete site1 folder. No need to re-install Drupal nor all contributed modules, since default installation remains intact and contributed modules are still in sites/all/modules.

To avoid path and redirect problems, name your sites/ folders as peers of your domain:

sites/dev.adastra.ca
sites/adastra.ca

1. Install WAMP

Quicklink:

2. Create Databases

  • Make sure Apache and MySQL services are running.
  • Launch phpMyAdmin via /phpmyadmin/ or WampServer icon in system tray.
  • Create base database: drupal6 (leave parameters as default - user: root, no password)
  • Create other databases: site1 and site2.

3. Install Drupal

  • Unzip Drupal 6 into c:\wamp\www\drupal6 folder.
  • Go to http://drupal6 and follow installation instructions.

4. Create Multi-side Folders

  • Copy /sites/default content to /sites/site1.
  • Open /sites/site1/settings.php and set $db_url to:

$db_url = 'mysql://root@localhost/site1';

  • Also, in settings.php uncomment and set $base_url to:

$base_url = 'http://site1'; // NO trailing slash!

  • Note: Close settings.php so you can proceed with step #9. If applicable, delete default.settings.php from /sites/site1
  • Repeat Step 4 for site2 and other sites.

5. Enable Virtual Host

  • Open C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf in Notepad (insert your Apache version number instead of 2.2.11).
  • Remove the # before Include conf/extra/httpd-vhosts.conf, as follows:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

6. Add Virtual Host

  • Open C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf in Notepad and add these lines at end of file:

<VirtualHost *:80>
DocumentRoot c:/wamp/www/drupal6
ServerName site1
</VirtualHost>

<VirtualHost *:80>
DocumentRoot c:/wamp/www/drupal6
ServerName site2
</VirtualHost>

<VirtualHost *:80>
DocumentRoot c:/wamp/www
ServerName localhost
</VirtualHost>

7. Map Virtual Host

  • Open C:/Windows/System32/drivers/etc/hosts in Notepad and add these lines after 127.0.0.1 localhost, as follows:

127.0.0.1   localhost
127.0.0.1   site1127.0.0.1   site2

8. Restart Apache

  • Save all changed files.
  • Select WampServer icon in system tray > "Restart all services".
  • Note: If you receive a white screen with "Forbidden Access" error message, "Restart all services" again.

9. Install Multiple Drupal Sites

  • Go to:http://site1/install.php and http://site2/install.php  to install the sites.
  • Go to:http://site1 and http://site2 to view your multi-site installations.

Modules/Themes Location

  • To share modules/themes between all sites, store them in sites/all/modules and sites/all/themes respectively.
  • To make modules/themes available only to one site, store them in sites/site1/modules and sites/site2/themes respectively.

Import Database Larger than 2MB

If you are importing an existing database that is larger than 2MB, you can use the WAMP menu to navigate to PHP > php.ini. In php.ini, increase the upload_max_filesize to:

upload_max_filesize = 8M

Note: Remember to set it back to default of 2MB after import.

Comments

NOTE: Your email is safe and will never be misused.

Another wow, I am so on the edge of my seat watching this website manifest. You are good at creating excitement, exactly what we want, thanks Tina you make it fun. I am truly inspired with what you have done, I love to witness brilliance.

Unlike other companies, who bill you for answering a question or picking up the phone, Tina only cares about making her clients happy. She'll spend the time you need, explaining or training, and I felt listened to and never rushed. (My doctor should learn manners from her.)
Dr. Jay Lepp, NSA Chiropractor

About the Director

Tina Chen, International Web StrategistI believe in the greatness in people. When I chose Doctors Without Borders over Chase Bank and UNICEF over The NY Times, I believed in people's potential to enhance the quality of life of others, thousands of others. This is why I do what I do. I use International Web Strategy™ to shine what YOU do.