• Logging IP’s on Apache while behind an ELB

    We recently had an issue where we had to track the IP’s of the remote hosts connecting to the servers behind our Amazon elastic load balancer. In order to accomplish this we had to adjust the LOGFORMAT of the apache server to log that X-FORWARDED-FOR header that is sent by the ELB. This can vary depending on the server, but you will either need to edit your httpd.conf or apache2.conf file (often in /etc/apache2/).

    Add the following to your apache config (comment out the existing settings).
    Read the rest of this entry »

    Share
  • Easily increase the size of your Ubuntu EBS boot volume with only console

    So you have run out of space on your EBS boot volume on Amazon’s EC2 and you do not know what to do? I will walk you through the steps you need to follow in order to easily increase the size of the default Ubuntu EBS boot drives (/dev/sda1) using just the Amazon webservices console. There is no need to use the ec2 command line tools, and you will only need to run one little command on the remote server when complete.




    Read the rest of this entry »

    Share
  • Simple guide for load balancing and scaling on Amazon

    Let’s say you have a simple website that you are expecting to go viral due to some news story or other potential viral type publicity. If you are hosted on Amazon, you have the capability to turn your little website into a monster with just a few clicks in the Amazon web console.

    The first thing you have to know is what is powering your website. Are you running a database and is the database on the same server? We are going to assume you are running a simple database and site all on the same server.
    Read the rest of this entry »

    Share
  • Simple Postgresql Cron Backup

    Here is a very simple method to backup your postgresql DB using a cron job and the pg_dump command. The main problem people encounter when trying to automate the pg_dump command is the password input. Now you could easily create a local user with no password, but why would you want to do that.




    Read the rest of this entry »

    Share
  • Installing Mongrel with Ruby 1.9

    Installing mongrel on ruby 1.9 has caused problems for many different people as has been reported on isitruby19.com.

    Running gem install mongrel produces the following error.

    http11.c: In function ‘http_field’:
    http11.c:77: error: ‘struct RString’ has no member named ‘ptr’
    http11.c:77: error: ‘struct RString’ has no member named ‘len’
    http11.c:77: warning: left-hand operand of comma expression has no effect
    http11.c: In function ‘header_done’:
    http11.c:172: error: ‘struct RString’ has no member named ‘ptr’
    http11.c:174: error: ‘struct RString’ has no member named ‘ptr’
    http11.c:176: error: ‘struct RString’ has no member named ‘ptr’
    http11.c:177: error: ‘struct RString’ has no member named ‘len’
    http11.c: In function ‘HttpParser_execute’:
    http11.c:298: error: ‘struct RString’ has no member named ‘ptr’
    http11.c:299: error: ‘struct RString’ has no member named ‘len’
    make: *** [http11.o] Error 1

    To install mongrel after receiving this error, just follow these steps: Read the rest of this entry »

    Share