Seven steps to use S3 as a media server.
- created an S3 account.
- Dowloaded the S3 Organizer plugin for Firefox.
- Restarted firefox and opened up S3 Organizer.
- Created a “bucket” (basically a new folder). To do this, it is just like creating a folder with an FTP client.
- Using S3 Organizer, I set my permissions to public for these directories, by right-clicking on the file name and setting public in the dialog box and checking the “Apply to sub-folders” box.
- In production.rb in config/environments, I revised this line to point to my asset server:
config.action_controller.asset_host = “http://quizical.s3.amazonaws.com”
Now all of my public files are being served from S3, a true asset server. So simple.
The only thing that threw me off for a second was the terminology used. The bucket reference I got. But the URL structure is listed as http://s3.amazonaws.com/bucket/key. I kept putting in my access key for the /key. Turns out, key is what Amazon calls the filename.
Filed under: Ruby on Rails, s3 | 3 Comments