Reverse proxy for Google App Engine Based on Amazon EC2

Source: Internet
Author: User

Recently, I want to repeat the GAE (Google App Engine), But GAE is under a wall in China. The solution I can think of is to find a server without a wall as a reserved proxy for GAE, as a result, I think of Amazon EC2 (in fact, there is nothing to look for, if you really want to build a site directly on EC2, it will be done, why do you go around ). No matter whether the solution is optimal or not, the right is regarded as an initial practical example of EC2.

Step 1: register an EC2 free account

You can register at http://aws.amazon.com/free/, but the most disturbing thing is that we need a credit card that can be paid outside China. Fortunately, I have a two-coin credit card, and the required information is on the card:

After registration, you will soon receive a US dollar fee deduction text message, but this is only a method for amazon to verify whether the account is valid and will be returned.

The registration process can also not complete the credit card fill, can fill in or change later, https://aws-portal.amazon.com/gp/aws/developer/account? Ie = UTF8 & action = payment-method

Step 2: Create an instance

After successful registration, you can access the EC2 console, https://console.aws.amazon.com/ec2/home

Click "Launch Instance" to create an Instance and select Classic Wizard:

1) Choose an AMI

Because my requirements are very simple, I only need an apache, so I chose the simplest"Basic 32-bit Amazon Linux AMI 2011.09". EC2 has a free capacity of 10 Gb. Therefore, you cannot select a complex underlying system. 8 GB is used in the simplest way. Therefore, you must make a good plan to balance your needs.

2) Instance Details

In this step, select the default value.

3) Create key pair

Key pair is used for instance login authentication in the future. here you need to create one:

Start a name, download it, and save it.

4) Configure Firewall

This is the development of configuring network ports. For a web server, SSH (for remote control), HTTP, and HTTPS (for web Access) are usually required ), TCP (used for development of self-made network services ):

After checking that the instance is correct, click "Lanuch" to create the instance.

Step 3: Start and log on to the Instance

The created instance is disabled by default, so you need to enable the instance through the console:

Remote logon and instance control can be done using common linux Remote control tools, such as Putty and SecureCRT. Here I use SecureCRT 6.7.3. This version can be used to log on directly with the generated key pair, secureCRT is easy to set, mainly to load the key pair file:

Click Properties:

Load the downloaded pem file.

You can remotely log on to the EC2 Instance

Step 4: install and configure apache

1) install apache: sudo yum install httpd

2) Configure proxy: sudoedit/etc/httpd/conf/httpd. conf

<IfModule mod_proxy.c>
ProxyRequests On
<Proxy *>
Order deny, allow
Allow from all
</Proxy>
Http://cutesource.appspot.com/proxypass/
Proxypassreverse/http://cutesource.appspot.com/
Proxyvia on
</Ifmodule>

Here is the simplest proxy settings, mainly to proxy all requests to Gae (http://cutesource.appspot.com /)

3) Start appche: sudo/etc/init. d/httpd start

Step 5: Assign elastic IPS

The instance we just created will automatically generate a public DNS, which is also the address we just accessed remotely, but this address will be automatically changed after the restart, which is similar to the dynamic IP address of our home broadband. Therefore, we need a fixed IP address and domain name. In the elastic IPS column can be created and bound to the instance, so we can have a fixed domain name, this example is http://ec2-23-21-223-133.compute-1.amazonaws.com/

However, take extra care about elastic IPs, which can easily produce charges. For more information, see http://aws.amazon.com/ec2/pricing:

If you generate an elastic IP address, you cannot stop the instance. Otherwise, you will be charged for $0.01/h. I just deducted a little fee because of the downtime.

By now, you have successfully experienced a Gae application that was previously forgotten by using http://ec2-23-21-223-133.compute-1.amazonaws.com/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.