Getting files from Amazon-EC2 server
I am making a video site, and all开发者_运维百科 the videos are in an EC2 server. How can I read them? I would like to insert in the database a field 'video_location' and here I can write the video location from the server, but I don't really have experience with Amazon servers and don't know how to read them, there is no url or anything... or is it?
Thanks!
You can 1) install something like Apache on the EC2 instance and use it to serve the videos or 2) store the videos on S3 and have S3 serve the videos.
There is nothing special about EC2 instances once you have them up and running. They are just like any other 'real' server so you would serve up your files like you normally would in any php app.
If you're actually talking about S3 then you can just link to your files using a normal url. For public files, the url structure is something like:
http://[bucket].s3.amazonaws.com/[key]
or
http://s3.amazonaws.com/[bucket]/[key]
For private files you need to generate a url that would look something like:
http://mybucket.s3.amazonaws.com/myimage.jpg?AWSAccessKeyId=44CF9SAMPLEF252F707&Expires=1177363698&Signature=vjSAMPLENmGa%2ByT272YEAiv4%3D
The easiest way to start interacting with S3 (or any other AWS service) would be to use the SDK for php.
精彩评论