Amazon WS

How to add a Volume to EC2 Instance?

Go to EC2 console to create the volume and attach it to the instance, and then we’ll mount the volume to make it available.

– under Elastic Block Store, click Volumes.
– Click on Create Volume – Select the General Purpose (SSD) volume type.
– Wait for your Volume to be available.
– Right click on it and select Attach Volume, Select the instance and specify an unused device name say /dev/xvdk

For making it available follow these steps:

[ec2-user ~]$ lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvdk    202:80   0   22G  0 disk
xvda1   202:1    0    8G  0 disk /

here xvdk device is not mounted.

To Mount it – mkfs -t ext4 /dev/xvdk
# mkdir /mnt/space
# mount /dev/xvdf /mnt/space

Voila, You just added the volume to the system.

To check it, df -h

[ec2-user ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            7.9G  1.1G  6.8G  14% /
tmpfs                 298M     0  298M   0% /dev/shm
/dev/xvdk              22G     0   22G   0% /mnt/space

Read More...

Amazon WS

Nginx show/set real ip address(public) from Amazon ELB Load Balancer address

To make it work, we need to add following lines to nginx configuration file:

real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;

It makes nginx to trust an X-Forwarded-For header from anyone, 
which makes Real Ip visible on logs and can be used in other programs 
where real ip is required.

Read More...

Amazon WS

Amazon SES Request Expired, it must be within 300secs/of server time.

While using Amazon Simple Email Service, sometimes we encounter this error message:

” AWS Error Code: RequestExpired, AWS Error Message: Request timestamp: Sun, 13 Mar 2011 06:10:27 GMT expired. It must be within 300 secs/ of server time.”

This error probably means that Amazon SES time differs from your system clock time. If you’re using the command-line tools then you may need to adjust your system clock to match Amazon SES’s clock, which is synchronized with UTC.

If you’re using a linux system try this:

[box type=”shadow”] $ sudo /usr/sbin/ntpdate 0.north-america.pool.ntp.org 1.north-america.pool.ntp.org 2.north-america.pool.ntp.org 3.north-america.pool.ntp.org[/box]

 

Fixed!!

Now you can easily send emails using SES.

Read More...