Hosting a static site on Google App Engine

I host a static landing page, www.iandexter.net, on Amazon S3. I also have another static site, my resume (resume.iandexter.net), but this time, it is hosted on Google App Engine (GAE).

Setting up a static site on GAE is a bit more involved than AWS S3. Still, it's fairly straightforward:

  1. Sign up for a GAE account.
  2. Download the latest SDK.
  3. Create a configuration file, app.yaml, similar to below:
    application: app-name
    version: 1
    runtime: python
    api_version: 1
    
    default_expiration: "30d"
    
    handlers:
    - url: /
      static_files: static/index.html
      upload: static/index.html
    
    - url: /
      static_dir: static
    
    - url: /.*
      static_files: static/404.html
      upload: static/404.html
    
    (It's a good idea to set up a 404 page similar to an Apache ErrorDocument.)
  4. Set up the directory where the static files will be located:
    ./app.yaml
    ./static
    ./static/index.html
    ./static/favicon.ico
    ./static/robots.txt
    ./static/404.html
    
  5. Test the site:
    /path/to/gae/sdk/dev_appserver.py app-name/
    viewable in http://localhost:8080.
  6. Once you're satisfied, deploy the static site:
    /path/to/gae/sdk/appcfg.py app-name/
    The site is located at http://app-name.appspot.com.

In my case, I set up the custom domain through Google Apps for Domains, pointing a DNS alias to ghs.google.com.

Comments

Popular posts from this blog

Pull files off Android phone