Sync your aws important file with s3 bucket in a simple way

Let us assume your databse storage folder is /var/lib/mongo ,which wants to keep daily sync using s3 bucket in order to recover the data due to unexpected server failure

-First do SSH login to the AWS ec2 instance and then do the follwing confuguration setup.

# aws configure
AWS Access Key ID [None]: xxxxxxxxxxxxxxxxxxx //Your AWS Key
AWS Secret Access Key [None]: yyyyyyyyyyyyyyyyyyyyyyyy //Your Secret Key
Default region name [None]: us-east-1
Default output format [None]: ENTER

 

then please enter the following command

aws s3 sync /var/lib/mongo  s3://YourBucketName/database/

 

if u want to setup daily sync then just go to crontab and add the above command with the prefer time .

 

Nginx Different Domains on Same IP

server {
    listen      80;
    server_name www.domain1.com;
    root /var/www/domain1;
}

server {
    listen       80;
    server_name www.domain2.com;
    root /var/www/domain2;
}


source url:http://stackoverflow.com/questions/11570321/configure-nginx-with-multiple-locations-with-different-root-folders-on-subdomain