WebSiteTemplate.org
AngelTech.US

Apple Certified Professional
Member of Apple Certification Alliance


Microsoft Certified Professional
Member of Microsoft Certified Professional

Having computer problems? Let our professionals solve them and help the poor at the same time!

Call us now (408) 916 - 3614 | support@angeltech.us

IIS

Setup PHP, MySQL on IIS 6

Setup Drupal Multisite on IIS 6 and Windows 2003

 

 

 

 

 

 

 

 

 

 

 

 

 

Setup PHP, MySQL on IIS 6

In this example, I used PHP 5.05 and MySQL 4.1.1.5 on Windows 2003 server; however, you should use the latest version of PHP and MySQL whenever possible.

  • Download and unzip php-5.0.5-Win32.zip into C:\php5 folder
  • In C:\php5 folder, make a copy of "php.ini-dist" to C:\Windows and rename it to "php.ini"
  • Add "c:\php5" into PATH environment variable

  • Under Web Service Extensions, add php as a new web service extension and Allowed it to be used



  • Reboot the server or restart IIS Admin in Services
  • Under site properies, set Execute Permissions to Scripts Only

  • and under Configuration, add .php as an ISAPI extension



  • Download and install mysql-essential-4.1.15-win32.msi
  • Run MySQL Server Instance Config Wizard (use MyIsam as default storage and network enable port 3306)
  • Download and install mysql-administrator-1.1.4-win.msi to manage the database
IMPORTANT: to move database from one computer to another, you may want to user mysql-administrator tool to BACKUP (button) a database to a file on a source computer and RESTORE (button) it on the destination computer to avoid database corruption.
  • To use MySQL with PHP 5, you need to load MySQL extension, modify the php.ini file and restart the IIS Admin under Services
extension_dir = "c:\php5\ext" (add approriate path)
extension=php_mysql.dll (un-comment)
  • To make sure php and mysql load correctly using this file to test, called it phpinfo.php
echo phpinfo();
?>

Setup Drupal Multisite on IIS 6 and Windows 2003

To see one of the reason why I use Drupal CMS over others like Joomla, Mambo, Typo3... read a research paper from IBM or compare these system from many cms matrix comparision sites on the Internet. In this example, I use Drupal 5.1 with the above PHP and MySQL database. Each site will have its own database.

  • Download and unzip Drupal to your server local hard drive. I use D:\Drupal
  • Go to D:\Drupal\sites and make a copy of the "default" folder and name it "default.orig"
  • From your IIS 6 server, create 2 (or more) new sites: www.site1.com and www.site2.com. Each has its web directory path point to D:\Drupal (YES, all the new sites that you create to use Drupal system have to point to this root folder D:\Drupal. Drupal system will do its job to redirect web request to the appropriate folder under D:\Drupal\sites)
  • Go to D:\Drupal\sites and make two copies of "default.orig" folder and name each new folder as www.site1.com and www.site2.com
  • Go to D:\Drupal\sites\www.site1.com and www.site2.com and grant "Internet Guest Account (IUSR_YOURSERVER)" the WRITE permission to the "settings.php" file
  • Go to your MySQL database and create 2 new databases: site1 and site2. Remember its username and password so you can supply to the Drupal installation wizard later.
  • Now it's time to install your new website using Drupal installation wizard. Use Firefox (recommended) or Explorer and go to www.site1.com. If everything properly setup, you should see Drupal installation wizard.
  • Enter correct database name (site1), its username and password that you created for this database above. Repeat this procedure to install www.site2.com
Now you can play with your two new web sites. Drupal system depends on cron.php running to do its necessary routine maintenance for each site, so it's important that you schedule a cron/task job on Windows 2003 server to run cron.php periodically. The following shows you how to run Drupal cron job for multisite every hour on Windows 2003 server.
  • Download "wget" software for Windows from www.christopherlewis.com/WGet/wget-1.10.2b.zip.
  • Unzip it and copy 3 files: wget.exe, libeay32.dll, and ssleay32.dll to D:\Drupal\wget (create wget folder if not exist)
  • Use notepad to create "multisite_cron.bat" with the following content:
wget -q http://www.site1.com/cron.php
del cron.php

wget -q http://www.site2.com/cron.php
del cron.php
  • Put this "multisite_cron.bat" file into D:\Drupal\wget folder
  • Now from the Command prompt of this Windows 2003 server, you will type the schtasks command as below to schedule a cron/task job that will run multisite_cron.bat every hour:
schtasks /create /sc hourly /mo 1 /tn "Drupal Multisite Cron Job" /tr D:\Drupal\wget\multisite_cron.bat


By now you should have multiple web sites running using the same/one Drupal code base. This will save you time and resources to maintain many web sites.

ABOUT US > RESOURCES > Windows Server Admin > IIS [Print Version]

Copyright 2006 - 2010 AngelTech.US