Windows Azure Companion上のWordPressで日本語を使うには

Windows Azure Companionを使ってWordPressをインストールするには、こちらの詳細な記事を参考にしていただくとして、日本語で記事を書けるようにするための方法を解説します。
Windows Azureで必要となるものは、以下の3種類となります。

  1. Windows Azure Hosted Services
  2. Windows Azure Storage Services
  3. SQL Azure Database

Windows Azure Companionをホステッド サービスへアップロードするには、事前に「ServiceConfiguration.cscfg」をカスタマイズする必要があり、カスタマイズする箇所を以下に示します。

 <!-- Windows Azure Storage Account Details. -->
<Setting name="WindowsAzureStorageAccountName" value="ストレージサービスのアカウント" />
<Setting name="WindowsAzureStorageAccountKey" value="ストレージサービスの共有キー" />
<!-- Admin user name, password and e-mail. Please user strong username and password -->
<Setting name="AdminUserName" value="管理者ユーザー名" />
<Setting name="AdminPassword" value="管理者ユーザーのパスワード" />
<Setting name="ProductListXmlFeed" 
value="https://wazstorage.blob.core.windows.net/azurecompanion/default/WindowsAzureCompanionFeed.xml" />

ここで注意しないといけないのが、「ProductListXmlFeed」に設定した値である「WindowsAzureCompanionFeed.xml」になります。2011年3月21日時点では、PHPやWordPressが以下のバージョンになっています。

PHP ランタイムについては、5.3.6が公開されていて、5.3.5はhttps://windows.php.net/downloads/releases/archives/へ移動されているからです。つまり、PHP ランタイムのダウンロードURLを変更する必要があります。

 <!-- 以下の内容を書き換えるか、コピーして新しいバージョンの要素を追加します -->
<installerFile version="5.3.5" 
    url="https://windows.php.net/downloads/releases/php-5.3.5-nts-Win32-VC9-x86.zip">
  <installationProperties>
    <installationProperty name="extensions" 
      value="php_curl.dll,php_gd2.dll,php_gettext.dll,php_mbstring.dll,php_mcrypt.dll,php_mhash.dll,php_mysql.dll,php_mysqli.dll,php_pdo.dll,php_pdo_mysql.dll,php_xmlrpc.dll,php_xsl.dll,php_zip.dll" />
  </installationProperties>
</installerFile>

#2011年3月21日10:00時点では、windows.php.netは停止しているようです。

次のWordPress 3.0.1 Beta 0.9.4は、残念ながら日本語などの文字が文字化けした状態でデータベースに格納されてしまいます。この理由から、3.0.1 Beta 0.9.3(wp-sqlsrv-3.0.1-beta-0.9.3.zip)に変更する必要があります。変更した内容を以下に記載します。

 <installerFileChoices>
  <installerFile version="3.0.1-0.9.3" 
    url="https://voxel.dl.sourceforge.net/project/wp-sqlsrv/distribution/wp/wp-sqlsrv-3.0.1-beta-0.9.3.zip">
    <installationProperties>
      <installationProperty name="applicationPath" value="wordpress" />
    </installationProperties>
  </installerFile>
</installerFileChoices>

上記のように変更したWindowsAzureCompanionFeed.xmlをWindows Azure Blob ストレージなどに保存して、ServiceConfiguration.cscfgのProductListXmlFeedのURLを保存先に設定します。
ちなみに、  ProductListXmlFeedをダウンロードするにはPowerShellで以下のようなコマンドを使用します。

 C:\Data\Companition>powershell
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Data\Companition> $wc = new-object System.Net.WebClient
PS C:\Data\Companition> $wc.DownloadFile(
"https://wazstorage.blob.core.windows.net/azurecompanion/" + 
"default/WindowsAzureCompanionFeed.xml",
"AzureCompanionFeed.xml")

 

後は、先にご紹介した手順に従ってWindows Azure CompinonからWordPressをインストールして、WordPressの環境を作成すればWindows Azureのコンピュート サービス上で WordPressが動くようになります。