Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Thanks

share|improve this question

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.