LoginSignup
2
2

More than 5 years have passed since last update.

AWS S3をWEBサーバにする方法

Posted at

静的コンテンツのみですが、AWSではS3をWEBサーバにすることができます。

以下の方法では、Bucket配下のフォルダは全て公開されます。

1.Bucketを作成する。(例として、examplebucket )

その後、設定するところはこの2つです。

S3_Management_Console.png

2.作成したBucketのpermissionを変更する。
Permission→Edit BucketPolicy で以下の設定をいれます。

{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"AddPerm",
        "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::examplebucket/*"
      ]
    }
  ]
}

念のため、元ネタもリンクしておきます。
https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html

3.Static Website Hostinを設定する。
・Enable website hostingにチェックを入れる

S3_Management_Console.png

そして、Bucketにファイルを配備すると、WEBサーバになっていることがわかります!


1秒あたり、どの程度のアクセスが受けられるのかはこのあたりを参考に
http://aws.typepad.com/aws_japan/2012/03/amazon-s3-performance-tips-tricks-.html

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2