Install movable type 4 on Windows Server 2008 with IIS7, PHP, Perl, CGI, MySQL

For the purpose of this how-to, I will be using a AWS EC2 Instance.You will need console or Remote Desktop access to a Windows 2008 Server.

  1. Login to your Server via Remote Desktop.
  2. Remove IE Enhanced Security Garbage to make life easier when downloading/testing things
    1. Start > Server Manager > Right side under Security Info “Configure IE ESC” > Turn Off for users + Administrators (screenshot)
  3. Add Webserver Role (IIS) & .cgi Role Service
    1. Server Manager > Roles > Add Role > Select WebServer (IIS) (screenshot)
    2. Click Next, Next, Until you get to “Role Services”
    3. Select both “CGI” and “ISAPI” Extensions under “Application Development” (screenshot)
    4. Click Next, then “Install”
  4. Download/Install ActivePerl (Latest version, x86 for 32bit OS)
    1. http://www.activestate.com/activeperl/downloads/
    2. Download the latest ” Windows Installer (MSI) “
    3. Use Defaults for installation (Directory: C:\Perl)
  5. Install movable type required PERL Packages
    1. Start > All programs > Active Perl > Perl Package Manager
    2. Press “CTRL+1″ to view all packages (or press the button in the interface)
    3. Search for “DBI”, right Click “DBI” and mark for installation (may already be installed)
    4. Search for “DBD-mysql”, mark it for installation
    5. Press “CTRL+ENTER” to install the packages
  6. Download Movable Type
    1. http://www.movabletype.org/downloads/stable/ (I used MT-4.32-en.zip)
    2. IMPORTANT: Do not download/use 4.33 IF you want monthly archives to work. There is a known Issue not yet documented by SixApart. Please see this post for more information: Monthly Archives not working in Movable Type 4.33
    3. Save the file to your desktop
  7. Extract Movable type & Move to web Directory
    1. Go to your Desktop
    2. Right click the MT-4.xx-xx.zip File, Choose Extract All
    3. Use Default Destination Location (ex: C:\Users\Administrator\Desktop\MT-4.33-en)
    4. Check the box for “Show extracted files when complete, click Finish
    5. After extracting, the folder MT-4.xx-xx should pop up, open the MT-4.xx-xx folder
    6. Hit “CTRL+A” to select all of the files and folders in the directory.
    7. Hit CTRL+C to copy all of the files
    8. Create a folder named “mt” inside of C:\inetpub\wwwroot\
    9. Create a folder named “blog” inside of C:\inetpub\wwwroot\
    10. Open your newly created “mt” folder and hit “CTRL+V” to paste all of the movable type files (screenshot)
    11. Open the folder “mt-static” (C:\inetpub\wwwroot\mt\mt-static)
    12. Hit CTRL+A to select all files
    13. Hit CTRL+C to copy all files
    14. Go into your blog folder (C:\inetpub\wwwroot\mt\blog)
    15. Hit CTRL+V to paste all of the copied files
  8. Configure IIS7 for Movable Type, and to use PERL for .cgi Extensions
    1. Open IIS Manager
    2. Expand your server, then sites, Click on Default Website, Then click “Basic Settings” on the right side (screenshot)
      1. Change the physical path to C:\inetpub\wwwroot\blog
    3. Right Click “default Web site” and select “Add Application…”
      1. use alias: mt
      2. and path: C:\inetpub\wwwroot\mt
    4. Click on “default website”
    5. Double click “Handler Mappings” (screenshot)
    6. On the right side, click “Add Module Mapping…” and configure it like this screenshot, or as it is below:
      1. Request path: *.cgi
      2. Module: CGI Module
      3. Executable: C:\Perl\bin\perl.exe “%s” %s
      4. Name: CGIPerl
      5. After Clicking “OK” you should be prompted “Do you want to allow this ISAPI Extension” Select “Yes”
  9. Test: Open Internet Explorer, browse too: http://localhost/mt/mt-check.cgi
    1. This page should show your current MT Configuration – and should look something like this (screenshot).
  10. Download & Install PHP
    1. Download the latest Windows binary ZIP File (not the installer) from: http://www.php.net/downloads.php
    2. Extract the zip to C:\PHP
    3. Copy C:\php\php.ini-dist to your desktop
    4. Rename the copied php.ini-dist to php.ini
    5. Right click php.ini and select Edit
    6. Search (CTRL+F) for extension=php_mysql.dll and uncomment it by the deleting the ; in front of it. This allows php to login to your MySQL Database
    7. Now move up in the php.ini code and look for extension_dir = “./”. Change“./” to “C:\php\ext”. This shows php where to load the extension=php_mysql.dll extension you just uncommented.
    8. Save php.ini
    9. Copy php.ini and paste it in C:\Windows
  11. Configure IIS for PHP
    1. Open IIS Manager (from start menu > search for IIS Manager)
    2. Expand the root server > Sites > Click on “Default web site”
    3. Double click handler-mappings
    4. Click “Add Script Map” located on the right
    5. Fill out the Add Script Map Window like so (screenshot):
      1. Request Path: *.php
      2. Executable: c:\php\php5isapi.dll
      3. Name: PHP
      4. NOTE: Some people say to use php5.exe instead of the DLL. My research showed that the .dll works best with IIS7
    6. Copy the file “libmysql.dll” from C:\PHP, and paste it in C:\Windows\System32 (this is a known fix for a bug)
  12. Test PHP Installation
    1. Open Notepad
    2. Type <? phpInfo() ?>
    3. Hit CTRL+S To save
    4. Change the “Save as type” to “All Files *.*”
    5. Filename: test.php
    6. Browse for folders and save this to C:/inetpub/wwwroot
    7. Open Internet explorer and browse to: http://localhost/test.php
    8. You should see something like this (screenshot).

  13. Install ImageMagick
    1. Download the latest Q16-windows-dll “Binary Installer” from the ImageMagick Website.
      example, I downloaded: ImageMagick-6.5.9-0-Q16-windows-dll.exe
    2. During Installation Choose the Default Installation Path & Start Menu Folder
    3. IMPORTANT: Make sure you check the box for “Install PerlMagick”. The version the installation wizard displays should also be the same Build as your installed Perl. (screenshot)
      1. You can check this by opening a command prompt and typing “Perl -v”. The version displayed should match what is shown in the installation Dialog. (screenshot)

    Important: Please reboot your server before continuing

  14. Install & Configure MySQL
    1. Download the latest MYSQL Community Server (x86, 32-bit, MSI Installer) from the dev.mysql.com website.
    2. Save the Installer to the desktop and run it. Choose Typical Installation
    3. Check the box to “Configure MySQL Now”
    4. Click Finish, then next, then “Standard Configuration”
    5. Use default setting to install MySQL as a system service
    6. Create a root password
    7. Click Execute to complete MySQL Installation
  15. Configure a MySQL Database & User for Movable Type
    1. Download MySQL GUI Tools from here
    2. Install the tools using all default selections in the wizard
    3. Launch MySQL Administrator & Connect to your MySQL Server Instance (screenshot)
      1. host: localhost
      2. username: root
      3. password: (the password you set in step 14.6)
    4. Once connected, Create a new Catalog (screenshot)
      1. Click Catalogs
      2. Right click below the default databses and select “create new Schema”
      3. Name your schema: mt (screenshot)
    5. Create a MT MySQL User
      1. Click User Administration
      2. Right click below the root user and choose “Create new User” (screenshot)
      3. Name your user “mtuser” , create a password
      4. Give your user permissions by clicking the “Schema Privileges” Tab, select the “mt” database, then Select all Available Privileges and click the “<” arrow to move them to “assigned”. (screenshot)
      5. Hit “Apply Changes”
  16. Configure Movable Type and Launch it! Finally!
    1. Open C:\inetpub\wwwroot\mt
    2. Copy mt-config.cgi-original
    3. Right click mt-config.cgi-original > Rename it to mt-config.cgi
    4. Modify the following lines in this file:
      1. CGIPath          http://localhost/mt
      2. StaticWebPath             http://localhost
      3. Remove all selections that do not refer to the MySQL Database
      4. Modify the MYSQL Section to use these values:
        1. Database mt
        2. DBUser mtuser
        3. DBPassword (your MT user MySQL password)
        4. DBHost localhost
        5. The final product should look exactly like this Screenshot
  17. Last step, visit your site, create your login, and start blogging!!!
    1. Open: http://localhost/mt/mt.cgi

After Completing this tutorial, you have a working Installation of Movable type 4.xx on Windows Server 2008, With IIS7, PHP, Perl, MySQL, and all the bells and whistles.

If you want your blog to be accessible via the internet, you will need to purchase a domain, and set DNS to point to the Server you just setup. You would also need to modify mt-config.cgi to use http://www.yourdomain.com for the staticwebpath, and http://www.yourdomain.com/mt for the staticCGIPath. Lastly, you would need to setup host-headers in IIS7. If you need help I am just a comment away! Cheers –

Tags: , , , , , ,

Subscribe

Subscribe to our e-mail newsletter to receive updates.

9 Responses to “Install movable type 4 on Windows Server 2008 with IIS7, PHP, Perl, CGI, MySQL”

  1. Aaron April 18, 2010 at 1:44 pm #

    Couple of comments:
    1. In section 7 does the blog folder go under the root or under the mt folder. Step 9 & 14 are kind of in conflict.

    2. In section 8.3.3 can you fix the link to the screenshoot. Maybe that will answer what you enter for the Alias

    3. Section 9 fails for me perhaps due to assumtions I made on other questions but I get HTTP Error 502.2 – Bad Gateway and it says it cannot find the cgi script but it is phyiscally there on the drive. Any suggestions?

  2. iainlbc April 18, 2010 at 2:46 pm #

    Good afternoon Aaron, I appreciate your patience :)

    1. In section 7 the blog folder should go under C:\inetpub\wwwroot\

    2. The alias should be “mt” , without the quotes ofcourse. I apologize for the missing SS.

    3. 502 Bad Gateway – Please let me know if adding that alias fixes it for you!

    Cheers -

    Iain

  3. pharmacy technician April 20, 2010 at 5:28 pm #

    My cousin recommended this blog and she was totally right keep up the fantastic work!

  4. IT apprentice April 24, 2010 at 12:13 pm #

    i cant understand why do you install PERL and PHP at the same time … if its a simple blog you want just install PHP and let it to handle the .cgi extensions … doesn't installing both of them increase your Area of Attack surface by 200%?

    • iainlbc April 24, 2010 at 8:16 pm #

      Honestly I just followed the requirements on the MT documentation that states Perl & ActivePerl are requirements to running Movable Type.

      I wonder if a Perl PHP Extension would suffice? You are right in that having both definitely exposes us to more threats.

      I actually need to restructure this a bit because PHP is only necessary if you want to do Dynamic Publishing within MT.

  5. IT apprentice April 24, 2010 at 12:14 pm #

    Thanks for the ImageMagick guide tho, was just the thing i was looking for to double check before setting it up

    • iainlbc April 24, 2010 at 8:02 pm #

      Happy to help! Let me know your address when its up so i can check it out :)

  6. rgrone April 29, 2010 at 7:40 am #

    Image::Magick is not configured

    I have installed and compiled Imagemagick as instructed, complied and viewed the little wizard however, Movable Type is telling me that it is not installed properly any ideas?

  7. iainlbc April 29, 2010 at 3:42 pm #

    Hi rgone,

    You need to give your server a reboot after the ImageMagick install, have you done this yet?

    Cheers

Leave a Reply