Customize Nginx config on Ruby1.9 Elastic Beanstalk

Requirement : Set a URL redirection in Nginx Configuration. Example : download.appygeek.com =>¬†https://play.google.com/store/apps/details?id=com.mobilesrepublic.appygeek On Beanstalk with Phusion Passenger Standalone [3.0.17] (Ruby1.9), Nginx customization is highly discouraged. However to accomplish this, the following workaround is done : Beanstalk generates the nginx configuration file from a ERB template each time when restarted. Hence the configuration change has […]

Full Access to a specific S3 Bucket except DeleteObject

{ “Statement”: [ { “Effect”: “Allow”, “Action”: [ “s3:GetBucketLocation”, “s3:ListAllMyBuckets” ], “Resource”: “arn:aws:s3:::*” }, { “Effect”: “Allow”, “Action”: [ “s3:ListBucket” ], “Resource”: [ “arn:aws:s3:::testbucket-unni” ] }, { “Effect”: “Allow”, “Action”: [ “s3:PutObject”, “s3:GetObject” ], “Resource”: [ “arn:aws:s3:::testbucket-unni/*” ] } ] } Details: Get and List actions given to “arn:aws:s3:::*” to enable console view List action […]

Install Newrelic Agent for PHP in a 1 minute

Install NewRElic PHP Plugin for Amazon LINux Create newrelic account on web and get the License number. sudo rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm sudo yum install newrelic-php5 sudo newrelic-install install vim /etc/php.ini newrelic.license=”4b3abfeda5336ecf68″ /etc/init.d/httpd restart Install System Monitoring NewRelic rpm -Uvh https://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm yum install newrelic-sysmond nrsysmond-config –set license_key=4b106d772c3115f649 /etc/init.d/newrelic-sysmond start

When you hit URL in browser

The 3 things that happens: 1.DNS Resolution 2.TCP connection 3.Browser Rendering 4.HTTP Request/Response   DNS Resolution http://www.example.com on Browser The operating system looks at /etc/host file,first for the ip address of http://www.example.com(this can be changed from /etc/nsswitch), then looks /etc/resolv.conf for the DNS server IP for that machine nameserver 172.16.200.30 nameserver 172.16.200.31 Pick 172.16.200.30 (call […]