1

I know in amazon's documentation it says S3 is not really made for server side scripting but to rather use EC2 instead. I don't need and will not use a operating system that EC2 provides to handle my server calls, it just seems pricey and seems to be an overkill. Basically, I have a couple php files that handle writing data to a RDS database and uploading videos to S3. Is it wrong for me to have my php files in S3 and allow static web hosting so that my iphone api can call the php scripts?

TMan
  • 4,044
  • 18
  • 63
  • 117

2 Answers2

3

Static web hosting means just that... no server-side script execution.

You cannot run PHP scripts on S3.

You can host a static website on Amazon S3. On a static website, individual web pages include static content. They may also contain client-side scripts. By contrast, a dynamic website relies on server-side processing, including server-side scripts such as PHP, JSP, or ASP.NET. Amazon S3 does not support server-side scripting.

http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html

Check out the EC2 free tier.

Eric J.
  • 147,927
  • 63
  • 340
  • 553
  • So what should I be looking into to do what I need? I'm new to aws btw, I know nothing yet. – TMan Mar 29 '13 at 00:32
  • You can use the EC2 free tier to get free EC2 hosting within limits. Added a link. – Eric J. Mar 29 '13 at 00:33
  • Would my videos be stored on EC2 now as well? Would I need RDS anymore – TMan Mar 29 '13 at 00:34
  • @EricJ. I believe that's free for one year though. – Ja͢ck Mar 29 '13 at 00:34
  • @Jack: That is one of the restrictions of the free tier, though if you have a second credit card and email address, you can probably sign up for a second free year. – Eric J. Mar 29 '13 at 01:07
  • What type of EC2 would be basic enough to handle my needs to calling database and saving videos? Redhat, Ubuntu, amazons linux ami? – TMan Mar 29 '13 at 01:50
  • @TMan: All three offer essentially the same capabilities. There are just slight variations in the specifics of each Linux distribution. Personally I use Ubuntu because that's what I'm most used to. – Eric J. Mar 29 '13 at 16:34
  • 1
    The best place to store videos is probably in S3, because you can optionally use CloudFront, Amazon's Content Delivery Network, with S3 to deliver the videos to your customers quickly no matter where in the world they may be. You can though store them in an EBS backed file system in EC2. See http://stackoverflow.com/a/3630707/141172 – Eric J. Mar 29 '13 at 16:37
2

S3 has no way of actually executing your PHP files. It is just file storage that just happens to also be able to also serve up files in response to basic HTTP requests. But it can only serve up static content in this manner.

There is however nothing that says you need to use EC2 for your web application. You can use whatever you want for that, though you will likely see bandwidth cost penalties around S3 that you may be able to avoid using EC2.

Mike Brant
  • 70,514
  • 10
  • 99
  • 103
  • So what should I be looking into? – TMan Mar 29 '13 at 00:31
  • Personally, I have been using AWS services for years and honestly wouldn't think of hosting anything other than a trivial website or application on anything else. – Mike Brant Mar 29 '13 at 00:35