Installation under Windows 2003

02/28/2005

Right after having bought Movable Type there were problems. Fact is that the installation description does not contain specific information for the Windows platform. Because of this, it took some time until I finally managed to make it work.

Looking back after having completed the installation successfully, it is not difficult. Until Six Apart gives better installation instructions for Windows users, maybe my description will help.

Introduction

The installation consists of the following parts

  • Installing the Perl runtime environment
  • Copying the Movable Type components
  • Configuration of some Movable Type files
  • Configuration of MS IIS
  • Creating the Movable Type Database

All screenshots can be clicked. An enlarged image will be opened in a separate window. Some screenshots are still in German. I will replace them as soon as possible.

Installing the Perl runtime environment

Movable Type is based on the programming language Perl. Prior to executing an application developed with this language, you have to install the corresponding runtime environment. Usually the runtime is free. Only the development environment has to be paid.

Installation Perl

I am no Perl developer and I do not have any experience with this language. Because of this, I relied on the commonly recommended company - ActiveState. The current version of ActivePerl is 5.8.6 Build 811. ActivePerl is distributed with an MSI based installation. The installation file is about 13MB in size. You can download it to an arbitrary directory and start it with a double click. You will be lead through a usual installation process.

Installation Perl

The installation program suggests installing into »C:\Perl«. You should change this setting when installing under Windows 2003. I recommend giving a directory name that does not contain any spaces. In a later step you have to enter the Perl installation path into some files. With one of my first installation attempts I had problems, when there were spaces in the path. Maybe experienced Perl developers know how to handle this. However, if you want to avoid any problems, simply choose a path without spaces - for example »C:\Programme\ActiveState\Perl«.

Installation Perl

The Programmer's Package Manager offers functions so that future updates or new installations will be easier. The state of your Perl installation will then be reported to a central place. We do not need this option for Movable Type and so we will ignore it.

Installation Perl

MS IIS (Internet Information Server) has to know about Perl. It must know, what it should do if a Perl program is executed via HTTP. The installation program can do some of the necessary settings. Therefore, it is reasonable if the options are set as in the screenshot.

After the installation program has ended the runtime environment for Perl is installed. Now the server will be able to execute a Perl program. We will test this at the beginning of the next step.

Installation db_file

Movable Type is able to save its data in several ways. For example, it is possible to save all data in a MySQL database. For today's installation I decided to save all data as plain files in the filesystem. These files are accessed by the so-called Berkley DB. For enabling, an optional component has to be installed. This can be done easily: open a command prompt, change the current directory to »C:\Programme\ActiveState\Perl\bin« and start the program »ppm«. A shell will open. Enter the command »install db_file«. Subsequently leave the program by entering »quit«.

Copying the Movable Type components

By downloading Movable Type from the Six Apart homepage, you will have all needed files in a normal ZIP archive. You will extract the files contained in the ZIP into a new directory and modify them slightly. However, before that we will create the virtual directory for Movable Type and execute the mentioned test.

For working with Movable Type you have to create two virtual directories. The first directory contains the Movable Type installation. If an author works with Movable Type, some programs from this directory will be executed. The second directory is the target directory. Movable Type will save the generated HTML files there.

Usually the first directory is not known to the public. Its address is only known to the authors. However, the second directory is known to the public. After all, it contains the HTML that will be read by your readers.

In my samples I chose »http://www.mgs-software.de/mt/« for the first directory and »http://www.movable-type.de/« for the second directory. The first address does not exist any longer. I only used it for testing.

MS IIS Webdiensterweiterung

Now open MS Internet Services Manager. Under Web Site Extensions you will see two entries that the Perl installation has created: »Perl CGI Extension« and »Perl ISAPI Extension«. Initially both are in state »prohibited«. You have to switch the Perl CGI Extension into the state »allowed« by clicking the pushbutton. Only then, IIS will be able to call Perl programs.

MS IIS Virtuelles Verzeichnis anlegen

Now create the virtual directory into which Movable Type will be installed. You can name both the description and the path for the home directory as you like it. On the screenshots you will see the description »MT« and the path »D:\DATA\IIS\MT«.

If the directory should not yet exist in the filesystem, you have to create it manually - for example with Windows Explorer.

MS IIS ISAPI Erweiterungen oder CGI

It is important to set the correct Access Permissions. A new virtual directory will not have the option »Execute (such as ISAPI or CGI)« selected by default. You have to select it manually.

You must set the »Default Content Page« for the virtual directory to »mt.cgi«.

As the virtual directory for Movable Type is ready, we can now perform a test concerning the Perl installation.

PerlScript Hello World

For this, copy the two files »hello.asp« and »psbwlogo.gif« from »C:\Programme\ActiveState\Perl\eg\aspSamples« into the directory »D:\DATA\IIS\MT« which we created in the previous step. If you now address »http://www.mgs-software.de/MT/hello.asp« in your browser, a Perl program starts and creates the output given on the right side. After finishing the test successfully, you can remove the two files.

The Movable Type ZIP archive contains a directory structure with the root being »MT-3.15-full-en_US«. Extract the contents below this root directory into the directory »D:\DATA\IIS\MT« which we have just created. For example, the file »D:\DATA\IIS\MT\mt.cfg« will be created.

Our installation will not make Movable Type save its data into an SQL database. Instead, a file-based storage will be used. Please create the directory »D:\DATA\IIS\MT\db« for this.

Configuration of some Movable Type files

We now have to modify some of the files in the Movable Type installation path »D:\DATA\IIS\MT«. If you change those files on your Windows 2003 Server, you must use an editor that is able to handle lines terminated with a CR (Carriage Return) and not with a CRLF (Carriage Return Line Feed). NOTEPAD does not recognize this kind of line termination properly. However, WORDPAD and many other editors do.

The file »mt.cfg« contains some parameters responsible for the configuration of Movable Type. You now have to set the parameter »CGIPath« that can be found near the beginning of the file. It must be set to the URL of your Movable Type installation

CGIPath http://www.mgs-software.de/MT/

Movable Type must know where to save the results. By default the following line can be found in »mt.cfg«.

DataSource ./db

That is the correct setting for our file-based storage. The other parameters in »mt.cfg« can be left untouched.

We have to modify some Perl programs next. These are...

  • mt.cgi
  • mt-add-notify.cgi
  • mt-atom.cgi
  • mt-check.cgi
  • mt-comments.cgi
  • mt-load.cgi
  • mt-search.cgi
  • mt-send-entry.cgi
  • mt-tb.cgi
  • mt-testbg.cgi
  • mt-view.cgi
  • mt-xmlrpc.cgi

Each of these files contains the information about where Perl has been installed. Initially a UNIX path is given, which under Windows has to be changed. You have to modify each of the above files so that the first line reads...

#!C:\Programme\ActiveState\Perl -w

I do not know what the reason for this setting is. I also cannot image a valid reason why it could be reasonable to save the path to the runtime environment in the source code. Maybe somebody, who knows Perl better than I do, is able to explain.

By the way, this is the place where spaces contained in the path might cause problems. If somebody knows how to handle these (maybe single / double quotes), I would like to hear from you.

Please pay attention to the file »mt-db-pass.cgi«. It also has the CGI name extension. However, you may not modify it as described above. When using MySQL, you will enter the password for accessing the database here.

Configuration of MS IIS

MS IIS Properties for a virtual directory

Now we will edit the configuration of the virtual directory. Open MS Internet Information Manager, and then select the properties for virtual directory »MT«.

The pushbutton »Configuration« will open a new dialog. There you will be able to link a filename extension to an application.

MS IIS Mapping a Filename Extension

Add a new Application Extension and enter the following command line into the textbox »Executable«. After you have saved this dialog, IIS will know that the Perl interpreter has to be called for CGI-files.

C:\Programme\ActiveState\Perl\bin\perl.exe "%s" %s

If you open an ASP-page on your Windows 2003 Server, IIS will execute the page in the security context of a well-defined user account. By default, this is the IUSR-account. However, you can change it to any user account. Regarding this, Perl makes no difference. The Perl programs are executed in the security context of the user account, which is specified on the »Directory Security« dialog page of the virtual directory. With Movable Type this account needs write access to »D:\DATA\IIS\MT\db«. After all that is the place where the data produced by your authors is stored.

You should create a new user account for Movable Type, make IIS use this user account for anonymous access, and give this user the necessary access rights.

Depending on the configuration of your Windows 2003 Server, an additional step may be necessary. If you later build your weblog, then click the »Syndicate this site« link on the main page, and an error message appears, please read FAQ: Syndicate file not found.

Creating the Movable Type Database

Movable Type Check

By installing Movable Type we have also copied the program »mt-check.cgi« into the installation path. This utility is able to test whether we did the installation correctly. Execute the program with the following URL. Some checks are done and some messages are output to your browser window. At the end a »Movable Type System Check Successful« is given.

http://www.mgs-software.de/mt/mt-check.cgi

Movable Type Load

Now we will initialize the Movable Type database. For performing this step, open the following URL. Please pay special attention to the message given at the very end: the file »mt-load.cgi« is no longer needed and should be deleted. I did not test this. However, I am rather sure that calling this program again would delete all results in the Movable Type database.

http://www.mgs-software.de/mt/mt-load.cgi

Movable Type Anmeldung

We now finished the Movable Type installation. Therefore, we can start it. Open the following URL and logon with the predefined account »Melody« and the password »Nelson«.

http://www.mgs-software.de/mt/

Movable Type Hauptmenü

If anything is ok, the Movable Type Main Menu will appear. You should immediately change the default account and password.

The installation has already created a new weblog. You must configure some path settings and URLs. The user account needs write access to the output directory for the weblog.

I will describe the needed steps in another entry.

mgs | 02/28/2005

Feedback is welcome!

What do you think about this entry? Was it interesting or boring? I would like to hear your comments. If the text was helpful, please consider setting a link to http://www.movable-type-weblog.com/.

No spam please!

For protecting this weblog I have installed the MT-Approval Plugin. You have to view a new comment in preview mode, before it is saved on the server. Moreover, I will view your comment manually, before it is published. You can find more information on the subject in the entry Weblog Spamming Basics.

With an active TypeKey session, your comment will be published immediately.

Post a new comment

TypeKey has temporarily been disabled at this location. Please create your comment without using TypeKey or log in from the preview dialog.




Remember Me?


Comment

gggggggggg | August 4, 2005 01:34 AM

Great post, thank you. I got it all working without too much fuss, exactley as you have described here.

I have trouble with this:
**********************************
In my samples I chose »http://www.mgs-software.de/mt/« for the first directory and »http://www.movable-type.de/« for the second directory. The first address does not exist any longer. I only used it for testing.
**********************************

I have done something similar as can be seen from the link at the bottom. However you mention that you dont use the second link anymore, can you please explain how you got around the security issue.


I have posted to MT Support without much luck, are you able to let me know how you did it.

Thank you
Greg

http://www.movabletype.org/support/index.php?act=ST&f=7&t=53554&s=7b8dabdb178893a09744cddddaca781e

Comment

Eric Schrepel | October 14, 2005 05:35 PM

I have MT3.2 working on IIS, but in a subdirectory (www.kbcrecords.com/bloga). I'd like it to be the root of my website instead (www.kbcrecords.com), and am unsure about what permissions to set at the website root level. I'm uncomfortable setting R/W/D at my web root just so MT can create folders and files for blog entries.

Any thoughts?

Comment

Michael G. Schneider | October 14, 2005 08:13 PM

Eric, you should create a separate user account, which is only used for Movable Type. Then make IIS run as this user, if the Movable Type admin interface is running. Now you can give the necessary access rights only this user.

If a normal user is reading your weblog, he will be using the standard IUSR account. However, if you are working with Movable Type (for example rebuilding your site), the special user with more access rights is used.

Comment

Linda Snyder | April 12, 2006 05:55 PM

We have the newest version of Moveable Type installed on a Windows 2003 server running IIS 6. All of our Blogs are company blogs; some of our Blogs are limited access. We are trying to limit the access through IIS by setting up user permissions and creating user groups. However, we have discovered that if we remove the IUSR_WEBSERVICES user (basically a guest account) from the permissions list, we cannot rebuild or post comments to the Blog from which it's been removed. But if we leave it in, then the Blog is open to anyone to view. This server is behind our firewall, so the outside world can't get to it.

This is the error we get when we try to post comments with the guest account missing:

Error making path 'D:\Inetpub\wwwroot\mt\ini\building\2006\03': mkdir D:\Inetpub\wwwroot\mt\ini\building\2006: File exists at lib/MT/FileMgr/Local.pm line 105

Line 105 is this:
eval { File::Path::mkpath([$path], 0, 0777) };

I'm not a programmer, nor do I know anything about servers. We are baffled by this. Does anyone else have a clue where we can go for help, or anything we can try, to get this issue resolved? I would appreciate ANY suggestions from any source!

Thanks,
Linda Snyder