1
votes

I have mounted s3 bucket on ubuntu using s3fs. All i need to do is access this bucket (which has got my media files) using apache. I did set DocumentRoot on /etc/apache2/sites-available to S3 path, but when i access http://ubuntu_domain_name:80/BUCKET it says 403. I did made bucket in S3 still it says 403. ( where ubuntu is an EC2 instance).

Then i pointed document root to some other directory, and created symbolic links to bucket, still i see 403 error.

All i want is, access S3 bucket with media files through apache sitting on ubuntu ec2.

Can anybody point me where i am doing wrong.

Thanks.

2
When you mount the filesystem you'll need to make sure it gets mounted such that the user apache is running as can read the files. It's probably being mounted with more restrictive permissions than that.Flexo
Thanks for the reply. Any help of mount is appreciated, I used this command, s3fs -o password_file=<path_pwd_file> BUCKETNAME /mnt/MOUNTPOINT , is there any other way to mount ?cb24
Assuming it's just a standard fuse filesystem adding allow_other into your list of options should be sufficientFlexo
Thanks for the reply. Looks like i found the answer. This is what i have done, s3fs BUCKETNAME -o allow_other -o password_file=<path_pwd_file> /mnt/mountpoint and in apache, i gave /mnt/mountpoint as document root.cb24

2 Answers

2
votes

It can be handy to set a default acl when mounting the bucket...

/usr/bin/s3fs my-bucket /mnt/my-bucket -odefault_acl=public-read

Important when configuring fstab as well....

I wrote a blog on it at thecodeabode: s3fs and ubuntu

-2
votes

You can also specify a uid and gid in the s3 connection string ie

;uid=5