More Related Content Similar to 20121112 jaws-ug sapporo8 (20) 20121112 jaws-ug sapporo84. AWSを利用するきっかけについて
← この人
Webサイト、社内の業務アプリ開発メイン
(サーバ/インフラには全く興味なし)
自社サイトはオンプレミス型で運用
(クラウドの知識は0)
12. EC2インスタンスからメール送信
Web Mail
Server Server
Email
AWS:申請ページ
大まかな手順
・メールサーバのDNS正引き設定
・メール送信制限解除・DNS逆引き設定の申
請
・sendmail/postfixの調整
費用は、EC2の課金
(インスタンス起動時間、データ転送量等)
13. AmazonSESからメール送信
Web
Server
Amazon SES Email
大まかな手順
・SES利用申請(テスト環境)
・送信元アドレスの設定
・本番利用申請
費用は、SESの課金
(データ転送量、メッセージ送信数)
17. postfixの設定
「/etc/postfix/main.cf」 追加
relayhost = email-smtp.us-east-1.amazonaws.com:25
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
「/etc/postfix/sasl_passwd」 新規作成
email-smtp.us-east-1.amazonaws.com:25 [アクセスキー]:[シークレットキー]
postfix再起動
sudo postmap hash:/etc/postfix/sasl_passwd
sudo /etc/init.d/postfix restart
20. 注意点
AmazonSESは、1日の送信制限があるので、制限を超えないよ
うに運用しましょう。
Cloudwatch+SNSで監視 AWS SDKを利用して、お好みの監視システムを使うのもよし
<?php
require_once("/opt/aws/php/sdk.class.php");
$ses=new AmazonSES();
$response=$ses->get_send_quota();
if ($response->status===200) {
$quota_result=$response->body->GetSendQuotaResult;
// 利用率
echo ($quota_result->SentLast24Hours/$quota_result->Max24HourSend*100);
}
24. Direct Hostingパターン
販売サイト
http://xxx.jp/
Web
Server
ユーザー コンテンツ
編集者
告知ページ
http://yyy.xxx.jp/
告知サイトのコンテンツはすべてS3に配置
27. Web Storageパターン
販売サイト http://xxx.jp/
告知ページ http://xxx.jp/yyy/
Web
Server
ユーザー コンテンツ
編集者
コンテンツ
http://yyy.xxx.jp/
✕
HTMLは既存サーバーに、JS、CSS、画像をS3に配置