Windows Azure でLL 言語系 Web アプリケーション開発 はてな 田中 慎司 stanaka @ hatena.ne.jp http://d.hatena.ne.jp/stanaka/ http://twitter.com/stanaka/
2.
アジェンダ Azure とはGAE/AWS と比較 試してみた Hello World 級 PHP on Azure PHP & MySQL on Azure Mediawiki on Azure
3.
スペック 基本的に Linux系 いわゆる LAMP スタック Linux, Apache, MySQL, Perl IDE は使わない Windows との接点 メインのノート PC は Windows VB, C# は知っている COM コンポーネントは一度書いたことがある VisualStudio
Amazon Web ServicesEC2 IA サーバ環境を提供 時間貸しレンタルサーバ ストレージ S3 CloudFront サービス Elastic Block Storage Relational Database Service SimpleDB Simple Queue Service
簡単な Azure アプリsimple.csdef クラウド・サービス定義ファイル <?xml version="1.0" encoding="utf-8"?> <ServiceDefinition name="Simple" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"> <WebRole name="WebRole"> <ConfigurationSettings> </ConfigurationSettings> <InputEndpoints> <!-- Must use port 80 for http and port 443 for https when running in the cloud --> <InputEndpoint name="HttpIn" protocol="http" port="80" /> </InputEndpoints> </WebRole> </ServiceDefinition>
簡単な Azure アプリindex.html <html> <head><title>Quick Sample</title></head> <body> This a quick sample. <br /> <img alt="Sample Photo" src="photo.jpg" /> </body> </html>
23.
簡単な Azure アプリビルド デプロイ >cspack simple.csdef /copyonly Windows(R) Azure(TM) Packaging Tool version 1.0.0.0 for Microsoft(R) .NET Framework 3.5 Copyright (c) Microsoft Corporation. All rights reserved. >csrun simple.csx simple.cscfg Windows(R) Azure(TM) Desktop Execution Tool version 1.0.0.0 for Microsoft(R) .NET Framework 3.5 Copyright (c) Microsoft Corporation. All rights reserved. Using session id 1 Created deployment(34) Started deployment(34) Deployment input endpoint HttpIn of role WebRole at http://127.0.0.1:82/
PHP on Azurephpsimple.csdef クラウド・サービス定義ファイル <?xml version="1.0" encoding="utf-8"?> <ServiceDefinition name="phpsimple" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"> <WebRole name="WebRole" enableNativeCodeExecution="true“ > <ConfigurationSettings> </ConfigurationSettings> <InputEndpoints> <!-- Must use port 80 for http and port 443 for https when running in the cloud --> <InputEndpoint name="HttpIn" protocol="http" port="80" /> </InputEndpoints> </WebRole> </ServiceDefinition>
PHP on Azureビルド デプロイ >cspack phpsimple.csdef /copyonly Windows(R) Azure(TM) Packaging Tool version 1.0.0.0 for Microsoft(R) .NET Framework 3.5 Copyright (c) Microsoft Corporation. All rights reserved. >csrun phpsimple.csx phpsimple.cscfg Windows(R) Azure(TM) Desktop Execution Tool version 1.0.0.0 for Microsoft(R) .NET Framework 3.5 Copyright (c) Microsoft Corporation. All rights reserved. Using session id 1 Created deployment(32) Started deployment(32) Deployment input endpoint HttpIn of role WebRole at http://127.0.0.1:82/
PHP & MySQLon Azure Windows Azure MySQL PHP Solution Accelerator http://code.msdn.microsoft.com/winazuremysqlphp MySQL php.exe に加え、 mysql.exe も送りこむ Worker Role で mysql のインスタンスを起動させる
38.
PHP & MySQLon Azure Windows Azure MySQL PHP Solution Accelerator をダウンロード・展開 PHP, MySQL, PHPMyAdmin などを詰め込む ディレクトリ構成
Mediawiki on AzureWindows Azure Mediawiki MySQL Solution Accelerator http://code.msdn.microsoft.com/winazuremediawiki 基本的には、 Windows Azure MySQL PHP Solution Accelerator と同等