How to Open Port in Amazon EC2 instance

By default Amazon EC2 only allow port 22 (SSH) on Linux servers and port 3389 (RDP) on Windows Instances. All other ports are closed for security reasons. Depending on your use case, you may need to open ports on the security group to allow connection to applications you run on the EC2 instance. Log in … Read more

Resize Amazon EC2 Boot Disk

Once you resize the disk in the Amazon AWS console, it gets auto resized on reboot. Sometimes this won’t happen, you have to manually resize the disk. Resize EC2 file system with LVM To resize the disk, do the following. 1) Take a snapshot of the disk 2) Create a new server in the same … Read more

Enable Gzip in Amazon Linux

To verify Apache module is loaded, run [root@ip-172-31-29-220 ~]# apachectl -M | grep deflate deflate_module (shared) [root@ip-172-31-29-220 ~]# Create file vi /etc/httpd/conf.d/gzip.conf Add following content # Restrict compression to these MIME types AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xml+rss AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE … Read more

Configure Postfix to use Amazon SES

Install postfix with apt-get update && apt-get install postfix libsasl2-modules -y Update postfix config with sed -i “s/default_transport = error/# default_transport = error/g” /etc/postfix/main.cf sed -i “s/relay_transport = error/# relay_transport = error/g” /etc/postfix/main.cf sed -i “s/relayhost =/# relayhost =/g” /etc/postfix/main.cf Edit vi /etc/postfix/main.cf Add to end of the file relayhost = [SMTP_SERVER_NAME]:587 smtp_tls_security_level = encrypt … Read more

Amazon AWS (awscli) command line interface

awscli is a command line tool for Amazon AWS. To install, run Create a virtual environment and activate it Install awscli with pip You can find more details at https://docs.aws.amazon.com/cli/latest/reference Once installed, you need to configure it aws configure To sync content of a folder to Amazon S3 bucket, run Whitelist IP in AWS security … Read more

Amazon Elastic IP The maximum number of addresses has been reached.

When assigning Elastic IP in Amazon AWS, I get an error The maximum number of addresses has been reached. This is because Amazon only allows 5 Elastic IP address per region. You can see the AWS service limits at http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html You can open a support ticket with Amazon, they will increase the Elastic IP limit. … Read more