2

Has anyone been successful in having their DocumentRoot reside on an S3 mount (using s3fs)?

I currently have a mounted bucket at /mnt/s3. I can read and write files to it no problem. In my httpd.conf I have DocumentRoot "/mnt/s3".

When I restart Apache I get the error "DocumentRoot must be a directory".

Has anyone tried something similar. My goal is to have a shared storage space so my nodes can scale easily and access the same document root.

Dave M
  • 4,514
  • 22
  • 31
  • 30
Hesse
  • 21
  • 1
  • 2

2 Answers2

3

Short Answer - No - S3 is not a block-level storage device so you can't use it as your apache root. You need to use EBS for that.

But - you can host your website on S3 if there is only static content (i.e. no PHP/ruby/etc - javascript is ok because it runs in the browser and not on the server) in which case you don't even need the apache server.

http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting.html

msEmmaMays
  • 151
  • 3
3

Yes you can do it, but it's not a simple way. You have to install fuse and s3fs from sources, then configure your S3 bucket and the policies for an IAM user, finaly you have to configure your mount point.

Here are some links that may help you:

https://www.emfluence.com/blog/amazon-web-services-integrating-s3-and-ec2-few-simple-steps https://github.com/s3fs-fuse/s3fs-fuse

I did it, but the performance is not good, I'm searching a way to optimize it a bit.

cyberacid
  • 31
  • 1