To be honest, I don’t know too much about Perl. However, to make the best weblog system work – Movable Type, I installed Perl onto my Windows XP machine from scretch. I believe I am not alone to install MT to Windows XP machines – although I believe there will not be too many people doing so – so I’d like to record the steps for other’s reference. It is also a good resource for myself if I need to rebuild the server.
Inetnet Information Server (IIS)
Install Perl on Windows XP
- Download ActivePerl for Windows XP from ActiveState. At the time I downloaed, the version was ActivePerl 5.6.1 build 633.
- After registering my user information, I choosed WIndows MSI package, which is 8.31M in size.
- It took me about 2 minutes and 51 seconds to download – thanks to the broadband provider – China Great Wall Broadband Corp[Chinese site]. I haven’t dreamed of downloading files larger than 5M in 10 minutes before.
- Install the MSI package. There is no any problem during the installation. I accepted all the defaul settings expect changing the default location from c:\Perl to c:\Program Files\Perl. I believe it is always good to follow the Windows convension instead of seeking for a place in root directory of C:\. This makes the disk hard to manage. Update: I am changing my mind recently. “C:\Program Files” folder is special in terms of Read-only settings and security permissions. Moving programs from their original location to this folder may bring unneccessary trouble if the program has never been tested in this environment.
Download MT source code
- Download the MT source code from http://www.movabletype.org/download.shtml. It is only 299K in size and took me 5 seconds to get it from the other side of the Pacific.
- Having MT-2.21.tar.gz on my disk, I met the first problem. I rely heavily on Windows XP to extract all .ZIP files and don’t use WinZip any more, but it seems I need to get my Winzip back. OK. Download a trial version from www.winzip.com and continue.
- Now all the source code is located in C:\Inetpub\Wwwroot\Mt folder, which can be accessed via http://home.wangjianshuo.com/mt. I am very serious about naming convensions. I cannot bear to put all the files directly into the root folder.
Configure IIS for Perl and perl script with .CGI extension to work
- I know it is wired for more green hand to have CGI run on Windows computer. At this time, if anyone access http://home.wangjianshuo.com/mt/mt.cgi, it will prompt to download the file instead of see the result. I configured IIS to recognize .CGI extension just as it recognize .ASP or .SHTML.
- In Inetmgr.exe, right click MT folder and select Properties. Click Create button in Application Settings area on Directory tab. Now we have created a seperate application.
- Click Configure and check the program to parse .pl files. It is C:\program files\perl\bin\perl.exe “%s” %s for my server.
- Note: The following changes can be changed on website level, no applicaiton level. Click Add and enter the same parsing program (C:\program files\perl\bin\perl.exe “%s” %s for my case) and enter .cgi to Extension text box. Click OK.
Configure MT to work on my site
- Open MT.cfg
- Changed the CGIPath to http://home.wangjianshuo.com/mt/
- Changed DataSource to c:\inetpub\wwwroot\mt\db\ (Alex reminded me that I need to state that you have to create the db folder yourself. The db folder does not exist by default).
Updated: Install additional MT modules
Before you can run your MovableType, you still need to install more required ActivePerl components. As stated in Checking for Perl Modules section of MovableType Installation menual, you need to run http://home.wangjianshuo.com/mt/mt-check.cgi.
At the time I downloaded ActivePerl, it includes most of the required modules except the following:
Typically, you need to follow these steps:
1. Start -> Run
2. Type “cmd” and click “OK”
3. In DOS command line, enter “PPM” (without quotation marks)
4. When PPM> prompt apprears, type “Install HTML-template”
5. Wait until it is installed, then type “Install Image-Size”
6. Type “Install DB_File”
7. Quite PPM program.
Thanks for Jeff for pointing this out. I forgot to add this item before.
Updated again Fail to Install DB_File
If you see this error message when installing DB_File
PPM> Install DB_File
Install package ‘DB_File?’ (y/N): Y
Installing package ‘DB_File’…
Error installing package ‘DB_File’: Read a PPD for ‘DB_File’, but it is not inte
nded for this build of Perl (MSWin32-x86-multi-thread)
You may try to follow the steps below:
- Visit http://ppm.activestate.com/PPMPackages/zips/
- Choose 5.6.xxx or 5.5.xxxx from the list. Typically, you are running on 5.6.xxx. So you should be directed to this page http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only/
- Find and download DB_File.zip (http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only/DB_File.zip)
- Unzip the file and put the extracted file to your local disk, for example, c:\temp\DB_File.ppd.
- In DOS command line, type
PPM Install c:\temp\DB_File.ppd
Complete the installation
- After all the steps are perfomed, there is very little work left. Just follow the installation instruction and it works very well.
- The user manual is also very good resource to go ahead to configure the MT system.
Updated Sending Email on Windows XP
Sending email on Unix system seems easy. Just configure the sendmail command and it will work. Typically you don’t have any SMTP server that you can configure MT to send to. To port MovableType on Windows system (Windows 2000 or Windows XP or Windows .NET Server), you will need to configure the SMTP services of IIS.
- Check you have IIS install with SMTP service. Start -> Control Panel -> Add/Remove Programs -> Add/Remove Windows Component. (or simply Start -> Run -> AppWiz.cpl). Ensure IIS is selected. You may also want to click Details… button to see if SMTP is installed within IIS.
- Make sure SMTP is started. Start -> Run -> InetMgr.exe. Make sure SMTP is up and running.
- Configure On properity sheet of SMTP Viture Server, click Relay button on Access tab. The default setting is “Only the list below”. Add the IP address of the server your MovableType is hosted to the list. Or, select “All expect the list below”. The later one is not recommended since it may open a door for spammers to use your server to send spams. (Microsoft has more detailed articles on configuration of SMTP Service.)
- Configure MovableType to send mail using local SMTP server. Uncomment the lines below in mt.cfg file.
Replace localhost with the host name of your SMTP server if you are hosting the servers on two machines.
- I’d like to thank Geo, who writes for www.russianlegs.com. He inspired me with the idea of WebLog. After talking with him on the issue of Google’s block in China, I was aware of the weblog trends and joined it.
- I also want to thank andersja, the owner of anderrsja’s blog. His site on weblog are very well done. I learnt a lot on categories and the pertential usage of MovableType from his site.
This posting is provided “AS IS” with no warranties, and confers no rights.