• Blocking IP’s while behind an Amazon ELB with Apache

    So Amazon does not allow accept/deny rules on their firewall system which is beyond silly in this day and age, but I digress. If you want to limit access to an apache server behind Amazon’s Elastic Load Balancer, your options are fairly sparse (although there are options).

    One such way to accomplish this is to first allow logging of the IP from the ELB using the X-Forwarded-For header. You can see how to do this here.

    So once you have setup logging of the IP’s in the apache logs, you now want to adjust the site configuration files. We have individual files in /etc/apache2/sites-available, so we add the following to the specific site. You may do something similar or you may have it all in a httpd.conf, or you can even put this into a .htaccess file.
    Read the rest of this entry »

    Share
  • 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
  • New Amazon EC2 Reserved Instances

    The good folks at Amazon have announced a new pricing scheme called a Reserved Instance to complement the On Demand instance. For a low one time payment, and about 20% of the instance hour cost, you can reserve capacity on 1 or 3 year terms. If you want to tie yourself into a long term contract but have a significantly reduced rate resulting in savings, this is the option for you.

    For a standard instance, on a per use basis you will pay approximately $880 for one year. Using the new reserved instance, you will pay about $580 for a savings of around $300. These are just rough estimates, but a reserved instance saves you around 30-50% versus On Demand instances.  The longer the term, the better your savings.  You will save $1300 on a 3 year term deal against an on demand instance running for 3 years straight.
    Read the rest of this entry »

    Share