Wordpress 2.7 on IIS7
liuzhijian.net在Godaddy的空间一直用得挺好,可惜那个IP被莫名其妙的“和谐”了 (国内用户不能访问,只有从国外可以访问)。兜转了一圈,博客又搬回了上海的服务器。 wordpress 本身的迁移基本上十分顺利,只需要把文件和数据库拷贝到新服务器上,配置一下wp-config.ini,就完成了。但是我对LAMP 基本上是外行, 配置WIMP (Windows-IIS-MySQL-PHP) 更是费了一番功夫。
环境: Windows Server 2008 Web 虚拟机 on Hyper-V (512M Memory)
系统准备:
1. 下载mysql - www.mysql.com , php 5 - http://www.php.net/downloads.php#v5。注意php只需要non-thread-safe的版本就OK了,因为IIS7本身有很好的机制监控管理thread的状态。
2. 安装IIS7。除了缺省配置以外,注意要额外安装”CGI”服务。
3. 我下载的mysql和php都是installer版本的,根据安装向导,在32位的Windows 2008上安装顺利。这里有一个插曲,我之前手工安装的php一直不能启动mysql模块,最后还是靠installer版的php才顺利装好mysql模块。建议大家都用installer,有界面的安装省心。
4. 安装FastCGI相应的补丁 (KB 954946);
5. 启动IIS中的URL Rewrite。这一步非常重要,因为wordpress中的Permalink功能主要用到URL Rewrite,这是wordpress SEO重要的基础。
1) 安装 URL Rewrite Go Live (http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1691)
2) 打开wordpress根目录下的web.config (如果没有,创建一个) 。在system.webserver 模块下加入下面的代码
<rewrite>
<rules>
<rule name=”Main Rule” stopProcessing=”true”>
<match url=”.*” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
<add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />
</conditions>
<action type=”Rewrite” url=”index.php” />
</rule>
</rules>
</rewrite>
到这里WIMP的环境准备顺利完成。如果你觉得必要,还可以安装Zend之类的php优化软件。但是php跑在IIS7上的性能比IIS6提高了许多,我决定先不装Zend体验一下。
参考内容:

Eddie 你费那么大劲整IIS 干吗啊?下载一个 XAMPP 就什么都有了。
看我两年前写的攻略:
http://www.fengdingcn.org/blog/20060920/apache-php-mysql-on-windows.html