Mount Amazon S3 to Centos 6.5/Redhat6.5 EC2 paravirtualized only

The below solution works only with a paravirtualized VM.

On git hub can be found a very nice puppet module which does exactly the same installation.

https://github.com/MSMFG/puppet-s3fs

First remove the fuse installed:

yum remove fuse fuse* fuse-devel

Install all the required packages:

 yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap vim wget -y

Navigate to the installation folder:

cd /usr/local/src

Download fuse and install:

wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz

tar -xvf fuse-2.9.3.tar.gz

mv fuse-2.9.3 fuse

cd fuse

./configure --prefix=/usr

make

make install

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/

ldconfig

modprobe fuse

pkg-config --modversion fuse

Install s3fs:

cd /usr/local/src

wget http://s3fs.googlecode.com/files/s3fs-1.74.tar.gz

tar -xvf s3fs-1.74.tar.gz

mv s3fs-1.74 s3fs

cd s3fs

./configure --prefix=/usr

make

make install

Create the s3 login file:

cd /root/

vim .passwd-s3fs

Add the below lines and save, modify your password accordingly.  Find credentials for your bucket on this link https://portal.aws.amazon.com/gp/aws/securityCredentials

bucketName:accessKeyId:secretAccessKey

Change file permissions

chmod 600 ~/.passwd-s3fs

Create the path where you want to mount the bucket

mkdir -p /var/www/html/folder

Testing command

/usr/bin/s3fs bucketName -o nonempty -o allow_other /var/www/html/folder -ouse_cache=/tmp

Umount the bucket

umount /var/www/html/folder

fstab mount with local cache, allow others to write and mount on a non empty folder

s3fs#bucketName   /var/www/html/folder    fuse    _netdev,allow_other,url=https://s3.amazonaws.com,use_cache=/tmp,nonempty        0 0

fstab mount without local cache, allow others to write and mount on a non empty folder

s3fs#bucketName   /var/www/html/folder     fuse    _netdev,allow_other,url=https://s3.amazonaws.com,nonempty        0 0