Using ReWrite rules for URL parameters

So, I was just contacted about a blog post that was accidentally deleted and recreated. Unfortunately, links to the old post had already been sent out. I wanted to use ReWrite to send anyone going to:
http://theblogdomainname.com/?p=376
to:
http://theblogdomainname.com/?p=375

a simple edit to my .htaccess file and viola! it works:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^p=375(.*) [NC]
RewriteRule ^.*$ http://theblogdomainname.com/?p=376%1 [R=301,L]

One nice thing about this is it preserves any parameters following the “p” parameter.  In this case, additional parameters were being used in the URL for tracking.

Amazon Web Services for Facebook Developers

Facebook has announced a partnership with Amazon Web Services.

I don’t quite see what the partnership involves other than some Facebook specific documentation and extra samples of facebook apps that run using AWS.

Either way, it’s good to see some more promotion of AWS. As you know, I’m a big fan. We’ve been using AWS with our We’re Related facebook app as well as the entire familylink.com website since October and love its instant scalability and cost savings. I’ll be posting more about our Amazon EC2 experiences later.

Ubuntu AMI for Amazon EC2 large & xlarge instances

TunnelI just released another Ubuntu public AMI for Amazon EC2. This one is nearly identical to the first one I released except it can be used with large and extra large instances.

Here are the current tech specs and costs for the different instance sizes:

Small Instance (Default) – $0.10/hr
1.7 GB of memory, 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit), 160 GB of instance storage, 32-bit platform
Large Instance – $0.40/hr
7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform
Extra Large Instance – $0.80/hr
15 GB of memory, 8 EC2 Compute Units (4 virtual cores with 2 EC2 Compute Units each), 1690 GB of instance storage, 64-bit platform

Using PAM with http auth

Palm TreeI was getting this error on one of my ubuntu linux installation (running apache2 with libapache2-mod-auth-pam installed)
PAM: user ‘username’ – not authenticated: Authentication failure

It took some digging around but I was able to fix it by making one change…
edit /etc/group and add www-data to the shadow group.
There are security implications to this. Beware! It gives the www-data user read access to the shadow password file (which contains password hashes.)

My apache config has these lines in it:

AuthPAM_Enabled on
AuthType Basic
AuthName "Authentication name here"
Require valid-user

Yay! it works. It’s a temporary fix until I get a central LDAP server setup to handle all authentication.

5 star review!

BoltsI released my first public AMI for Amazon’s EC2 service a few weeks ago. Last Monday, it got a 5 star review!

For those of you that don’t know what EC2 stands for, it is Amazon’s Elastic Compute Cloud. Still wondering what it is? You are not alone, it’s not a very descriptive name.

Basically, you can start up your own server instance (or multiple instances) on Amazon’s network for anything you want to use it for (legally.) An instance is like a server. The cost is between $0.10 and $0.80 an hour, depending on how powerful you want your instance to be. You can start up new instances in a matter of minutes.

For example, let’s say my blog starts getting a ton of traffic because people finally realize how great it really is. As traffic grows, my little server probably won’t be able to handle the load and people would start getting a “server is currently unavailable” message. To handle this sudden burst in popularity I could start up 20 servers on EC2 in less than 5 minutes, switch my site over there and people wouldn’t get a “server is currently unavailable” message. Thus fulfilling the technological knowledge needs of millions of users every minute.

I had previously been doing some contract work for a few companies that were using EC2 and thought I should release the base server image I’ve been working on.

Here’s a link to the page describing my Ubuntu 6.06 (Dapper) AMI