Hello David,
I was able to mount my s3 bucket directly in my ubuntu 11.10 ec2
instance to /var/www/filestore
All uploaded files are sent right to my s3 bucket.
To make this work, I used s3-simple-fuse:
http://code.google.com/p/s3-
simple-fuse/
Installed the pre-requisites:
apt-get install python-fuse
apt-get install python-dateutil
apt-get install python-boto
Followed instructions on how to install s3-simple-fuse
Found a great tutorial by Ashton Bond, outlining how to mount an
Amazon S3 bucket as a drive in Ubuntu:
http://www.asherbond.com/blog/2010/09/14/mount-an-amazon-s3-bit-bucket-as-a-drive-in-unix-using-fuse/
I customized his startup script and placed all of the variables in the
script itself, that way just the name of the script could be run:
http://dl.dropbox.com/u/474217/rs/s3-mount.txt
Named the startup script "s3-mount.sh"
and placed it into /etc/init.d/
Gave the script permission to execute:
sudo chmod +x /etc/init.d/s3-mount.sh
Tested the script by running it:
/etc/init.d/s3-mount.sh
If all goes well, a few lines of confirmation messages should appear.
Then if you cd into the directory:
cd /var/www/filestore/
You should see your S3 bucket files.
To make sure the s3 drive mounts automatically on boot, I added the
path to the script to rc.local:
sudo nano /etc/rc.local
Added the following line to rc.local right above the "exit 0":
sudo /etc/init.d/s3-mount.sh
Then in ResourceSpace Config:
sudo nano /var/www/include/config.php
I added the external file storage settings:
$storagedir = '/var/www/filestore';
$storageurl = '
https://s3.amazonaws.com/YOURBUCKETNAME';
Restart apache:
sudo /etc/init.d/apache2 restart
Then, in the Amazon S3 console, I had to edit the bucket policy to
allow view permissions on the files.
If you don't do this part, your images won't show up in ResourceSpace
after they are uploaded, just broken links.
Add the info below to your bucket policy:
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:*",
"Resource": "arn:aws:s3:::YOURBUCKETNAME/*"
}
]
}
These were the steps that I took to get it working on my Ubuntu 11.10
EC2 instance.
I have noticed that if you upload file sizes over 100 megs, the
performance of the EC2 to S3 data transfer is a bit sluggish.
Hope some of this info helps!