Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to run a micro instance on EC2 that will serve as a proxy server for my GAE app. I found this article on how to run it on ami-ad7e2ee8:

http://blog.magicalhobo.com/2011/04/11/running-a-reverse-proxy-for-app-engine-on-amazon-ec2/

but that ami seems to be no longer available. Can someone tell me which free-tier ami to use if I want to easily make a proxy server like that, or if it is impossible this way, what other way can I run a proxy server as a free EC2 instance (a step-by-step tutorial would be welcomed)?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The procedure outlined in that article essentially amounts to changing your DNS settings to point your domain at the EC2 instance, and running Nginx (a webserver) on that EC2 instance, with it proxying requests to Google Apps. This general idea can be applied to almost any AMI. I would recommend using the 32-bit version of Amazon's Linux AMI (ami-7f418316) for the purpose (it works in the free tier, and is optimized for good performance. It is based on RHEL/CentOS, so you would would change the following lines:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nginx

Into:

sudo yum update
sudo yum install nginx

The remaining instructions remain essentially the same (although, I don't believe the 'sites-available' is created by default, and the main nginx config file is in /etc/nginx/nginx.conf).

As an aside, if you use the AWS console to launch your instances, you will note a yellow star beside instances that are eligible for use in the free tier. Any of them should work fine for this purpose, although, the simplest ones (i.e. ones that have not been pre-loaded with an assortment of unnecessary software) would be the best suited to your purpose.

If you do wish to stick with an Ubuntu AMI, you can find the official list at Ubuntu's EC2 Starters Guide. This lists ami-f333fe9a as the current Ubuntu 10.10 32-bit AMI (which is eligible for the free tier), although, you may prefer to use 32-bit Ubuntu 11.04 instead (ami-e358958a).

share|improve this answer
    
So in order to run the proxy, I should create "sites-available" directory, then the "default" file, write the contents in, save and run nginx? Since currently I`m having a problem saving the file: ""/etc/nginx/sites-available/default" E212: Can't open file for writing". –  ThePiachu Oct 11 '11 at 18:59
    
a) Check your /etc/nginx.conf file - it may have a line like 'include /etc/nginx/sites-enabled/*.conf;` which will tell you the name of the directory to use. b) You don't actually need to create a directory for one site, you can just add the block to nginx.conf c) If you can't open the file for writing, in most cases, either you don't have permission (sudo) or the directory doesn't exist –  cyberx86 Oct 11 '11 at 22:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.