Archive

Archive for the ‘AWS’ Category

Beware: S3 doesn't support "+" in filenames (properly)

January 12th, 2017 1 comment

Discovered this issue the other day.

While you can upload a file with a plus "+" in it, it won't reject you. However, you cannot directly access it. You can only access it by encoding the "+" to "%2b" - so unless you are doing that in your links, you'll wind up with "access denied" S3 XML error. Because the "+" is interpreted as a space - instead of the actual "+"

While they could fix this, it looks like they won't at this point, as it will change the behavior that everyone is used to. I found some threads from years ago complaining about it, even back then there was little expectation the behavior would be changed.

Total complaints with S3: 3
Total happiness points with S3: 1,292

Categories: AWS

Automatically installing New Relic on Elastic Beanstalk

July 10th, 2016 No comments

Nearly 100% automated - it looks like the only way to grab an environment variable right now is through some nasty hacks.

Other than the one hard-coded thing at the moment, this seems to work well. Sets up the New Relic configuration as desired, on instance creation. Assuming stock PHP 5.x Amazon Linux AMI.

Just drop this in .ebextensions/00_newrelic.config or something of the sort, and rebuild your environment.

files:
  "/etc/php.d/newrelic.ini":
    mode: "00644"
    owner: root
    group: root
    encoding: plain
    content: |
      extension=newrelic.so

      [newrelic]
      newrelic.appname = "`{ "Ref" : "AWSEBEnvironmentName" }`"
      newrelic.browser_monitoring.auto_instrument = true
      newrelic.capture_params = true
      newrelic.enabled = true
      newrelic.error_collector.enabled = true
      newrelic.error_collector.record_database_errors = true
      newrelic.high_security = false
      newrelic.license = "YOUR LICENSE KEY HERE"
      newrelic.transaction_tracer.detail = 1
      newrelic.transaction_tracer.enabled = true
      newrelic.transaction_tracer.explain_enabled = true
      newrelic.transaction_tracer.explain_threshold = 2000
      newrelic.transaction_tracer.record_sql = "raw"
      newrelic.transaction_tracer.slow_sql = true

  "/tmp/install-newrelic.sh":
    mode: "00555"
    owner: root
    group: root
    encoding: plain
    content: |
      #!/bin/bash
      rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
      yum -y install newrelic-php5

commands:
  00_install_newrelic:
    command: "/tmp/install-newrelic.sh"
Categories: AWS, PHP