amazon s3による静的webサイトホスティング

93
Amazon S3による静的Webサイトホスティング 1

Upload: yasuhiro-horiuchi

Post on 14-Dec-2014

31.752 views

Category:

Technology


3 download

DESCRIPTION

静的なWebサイトのホスティングにAmazon S3を活用する方が増えています。 簡単に設定でき、安くて、安全で、手間いらずな、Amazon S3によるウェブサイトの設定、および運用方法をデモを交えて具体的に説明します。またウェブサイトを運用する上で便利なS3の機能の紹介や、AWSのDNS権威サービス、Amazon Route53 を用いた独自ドメインによる運用、AWSのCDNサービス、CloudFrontを用いた高速にサイトを配信する方法もお話いたします。

TRANSCRIPT

  • 1. Amazon S3Web 1
  • 2. Who am I ? ( ) 1978 AWS 130 2012 35 120(AWS) Amazon Web Services http://aws.typepad.com/aws_japan/ 10+ years web engineer in startups Director of V-cube (perl), 2001 - 2006 CTO of FlipClip (perl), 2006 - 2009 CTO of gumi (python), 2009 - 2012 @horiuchi horiyasu !
  • 3. Amazon S3?
  • 4. Amazon S3AWS 30 & SDKs Java, PHP, .NET, Python, Ruby, node.js IDE Eclipse Visual Studio Amazon SNS Amazon SQS Amazon SES Web Management Console AWS IAM Amazon CloudWatch Amazon Cloud Search AWS Elastic Beanstalk AWS Cloud Formation AWS OpsWorks Amazon SWF Amazon CloudFront Elastic MapReduce Amazon Elastic Transcoder Amazon EC2 Auto Scale Amazon S3 Amazon EBS Amazon Glacier AWS StorageGateway Amazon RDS Amazon DynamoDB Amazon ElastiCache Amazon Redshift & Amazon VPC / Amazon Elastic Load Balancer / Amazon Route 53 /AWS Direct Connect Region & AZ AWS
  • 5. Amazon S3? S3 8 A B C 3 ( ) 1GB/ 10 : 99.999999999%
  • 6. Amazon S3 = 1100 = URL 15TB
  • 7. Amazon S3 Amazon S3
  • 8. Amazon S3 - Amazon S3 mculver-images Beach.jpg media.mydomain.com 2009/maui/sun.jpg img1.jpg img2.jpg public.blueorigin.com Installer.msi img/pic1.jpg
  • 9. Amazon S3 Durable() Available () Scalable () Secure () Fast () Simple () Cost Eective ()
  • 10. Durable() 3 99.999999999% 3DC
  • 11. Available() 99.9%SLA100% 8
  • 12. Scalable() 1 15TB
  • 13. Secure() SSL ACL//IAM / ISO27001/PCI-DSS/SOC1
  • 14. Fast() 85/ 8
  • 15. Simple() PUT/GET/DELETE/LIST Plug & Play: 3rd SDK: S3 SDK Internet Web Services API HTTP(S) S3 & /or Glacier S3 AWS Storage Gateway
  • 16. Cost Eective()
  • 17. Amazon S3 1TB/ $0.100/GB $0.085/GB $0.068/GB 450TB/ $0.075/GB $0.070/GB $0.056/GB 4PB/ $0.065/GB $0.052/GB 5PB/ $0.060/GB $0.044/GB $0.005 1,000 Free GET $0.004 10,000 $0.060/GB 500TB/ PUT,COPY,POST,LIST $0.080/GB 49TB/ (RRS) 99.99% IN IN $0.000/GB OUT 1GB/ $0.000/GB 10TB/ $0.201/GB 40TB/ $0.158/GB 100TB/ $0.137/GB 350TB/ $0.127/GB 350TB/ CloudFront$0.09/GB 20139
  • 18. S3
  • 19. S3 110
  • 20. 1: 10000PV157 100 1 30 1 1MB PV 10000 10/GB 0.4/10000 15.7/GB 1 12 144 157
  • 21. 210000PV76.5 100 1 30 1 500KB PV 10000 10/GB 0.4/10000 12 15.7/GB 64 0.5 76.5 !!
  • 22. 3: 100PV15,601 100 1 30 1 1MB PV 10000 10/GB 0.4/10000 15.7/GB 1 1,200 14,400 15,601
  • 23. 100PV 15,000? 100PV x 1% x 10 = 10 PV = 0.1 S3 PV = 0.015
  • 24. S3 + Ad = 1up
  • 25. S3Web 1. WebS3 2. 3. HTML 4. S3website endpoint
  • 26. Web [All Buckets] 1. [All Buckets]
  • 27. Web 1.
  • 28. Web [Static Website Hosting] 1. [Static Website Hosting]
  • 29. Web [Enable website hosting]Index Error Document [Save] 1. [Enable website hosting] 2. [index.html] 3. [error.html] 4. [Save]
  • 30. Web Endpoint EndpointURLIndex Document(index.html)URL Error Document(error.html) Endpoint
  • 31. [Permissions][Add bucket policy] Bucket Policy Editor 1. [Permissions] 2. [Add bucket policy]
  • 32. Editor [Sample Bucket Policies] 1. [Sample Bucket Policies]
  • 33. [Granting Permission to Anonymous User] 1.
  • 34. Editor 1.
  • 35. [bucket] [Save] 1. 2. [Save]
  • 36. [Add bucket policy][Edit bucket policy] Edit bucket policy
  • 37. HTML Upload 1. 2. [Upload]
  • 38. HTML [Add Files]index.html error.html
  • 39. HTML [Start Upload] 1. [Start Upload]
  • 40. HTML [Done]
  • 41. WebEndpoint WebEndpoint[Properties][Static Website Hosting] Endpoint
  • 42. WebEndpoint
  • 43. URL
  • 44. Route53
  • 45. What is Amazon Route 53? AWSDNS DNSIP DNSTier-0 Route 53 DNS53 AWS Route 53
  • 46. www.example.com ? 53 Users DNS Resolver 1.2.3.4 Route 53 1.2.3.4
  • 47. CloudFront and Route53 Global Network Ashburn, VA Amsterdam Dallas/Fort Worth, TX Dublin Hayward, CA Frankfurt Jacksonville, FL London Los Angeles, CA Miami, FL New York, NY Sao Paulo Madrid Milan Newark, NJ Paris Palo Alto, CA Stockholm San Jose, CA Seattle, WA South Bend, IN 42 (20139) Chennai Hong Kong Mumbai Osaka Seoul Singapore Sydney Tokyo
  • 48. Route53 DNS
  • 49. Route53 Anycast IP ,IP
  • 50. Route 53 AWS SLA Anycast IAM DNS API
  • 51. Route 53 ELB(Elastic Load Balancer)S3 CloudFront AWS DNS CloudWatch CloudWatch DNS DNS
  • 52. .com Route53
  • 53. [horiuchi.hands-on.mobi] [horiuchi.hands-on.mobi] [horiuchi.hands-on.mobi]S3 [horiuchi.hands- on.mobi]Web
  • 54. Amazon Route53 Route53 1. [Services] 2. [All AWS Services] 3. [Route53]
  • 55. [Create Hosted zone]
  • 56. Domain Name Comment
  • 57. [Create Hosted Zone]
  • 58. Delegation Set4
  • 59. .com
  • 60.
  • 61. 4
  • 62. DNS Route53[Go to Record Sets]
  • 63. DNS [Create Record Set]
  • 64. DNS NameValueS3WebEndpoint [Create Record Set]
  • 65.
  • 66. Amazon S3
  • 67. Amazon S3 Web
  • 68. S3 + Route53www(: example.com)S3
  • 69. S3S3 PropertyLogging xxx.example.com accesslog.xxx.example.com
  • 70. Amazon Glacier (1GB1 ) PropertyLifecycle or Glacier
  • 71. Web () KeyWebsite Redirect LocationValue HTTP301
  • 72. Web () PropertyStatic Website HostingEnable website hostingEdit Redirection Rules 404 404 images/xEquals> index.html XML http://docs.aws.amazon.com/AmazonS3/latest/dev/HowDoIWebsiteConguration.html
  • 73. Web () PropertyStatic Website HostingRedirect all request to another host name
  • 74. 1. Deny 2. 3. Deny Deny 4. Allow Allow 5. Deny
  • 75. Amazon CloudFront
  • 76. Amazon CloudFront Highlights Copyright 2012 Amazon Web Services
  • 77. CloudFront AWS 20/GB Copyright 2012 Amazon Web Services
  • 78. CloudFront and Route53 Global Network Ashburn, VA Amsterdam Dallas/Fort Worth, TX Dublin Hayward, CA Frankfurt Jacksonville, FL London Los Angeles, CA Miami, FL New York, NY Sao Paulo Madrid Milan Newark, NJ Paris Palo Alto, CA Stockholm San Jose, CA Seattle, WA South Bend, IN 42 (20139) Chennai Hong Kong Mumbai Osaka Seoul Singapore Sydney Tokyo
  • 79. CDN Web
  • 80. DNSHTTP local DNS example.com DNS 2 1 3 www.example.com? 1. DNS www.example.com 2. www.example.comCNAMEIP (A) 3. IPHTTP
  • 81. CloudFrontHTTP IP
  • 82. DNSHTTP(CloudFront) example.com DNS local DNS 2 1 cloudfront.net DNS 3 4 5 CloudFront 1. DNScloudfront.example.com 2. 3. 4. 5. cloudfront.example.comXXXX.cloudfront.netCNAME XXXX.cloudfront.netIP cloudfront.netDNSCloudFrontIP CloudFrontIPHTTP
  • 83. Amazon CloudFront CloudFront 1. [Services] 2. [All AWS Services] 3. [CloudFront]
  • 84. S3CDN (CloudFront) 2. [Create Distribution]
  • 85. Delivery method[Download][Continue] 1. [Download] 2. [Continue]
  • 86. Origin Domain NameWebS3 1. S3
  • 87. Default Cache Behavior Settings
  • 88. Distribution Settings
  • 89. [Create Distribution] 1. [Create Distribution] [Status] InProgress Status InProgress
  • 90. StatusDeployed Status Deployed
  • 91. CloudFront URL : http://[CloudFrontDomain Name]/index.html : http://[CloudFrontDomain Name]/img.jpg
  • 92. Amazon S3! !
  • 93. Amazon S3 http://aws.amazon.com/jp/s3/ Amazon S3 Getting Started Guide http://docs.amazonwebservices.com/AmazonS3/latest/gsg/ Amazon S3 Developer Guide http://docs.amazonwebservices.com/AmazonS3/latest/dev/ Amazon Web Services Japan blog http://aws.typepad.com/aws_japan/