Parking Page on Cloud Storage

Now that I’m using Google Domains, I thought that it only appropriate to have my parking page on Google Cloud Storage. It turned out to be pretty easy.

  1. Create a Google Cloud Storage bucket with your desired website name. You may need to prove that you control the domain before creating the bucket. In my case, Google knew that because they were the registrar.
  2. Build your static parking page. I started with the Grayscale template from Start Bootstrap and made my changes.
  3. Copy the static content up to Google Cloud Storage.
    1
    2
    3
    4
    gsutil cp -a public-read -R * gs://www.dwightshih.com
    # -a public-read gives the requester OWNER permission
    # and all other users READ permission
    # -R for recursive copy
  4. Update the bucket configuration to serve index.html when a bucket listing is requested via the CNAME alias.
    1
    2
    gsutil web set -m index.html gs://www.dwightshih.com
    # use -e <404.html> to specify an error page

  5. Update your DNS CNAME alias to c.storage.googleapis.com:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    $ dig www.dwightshih.com

    ; <<>> DiG 9.8.3-P1 <<>> www.dwightshih.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28866
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;www.dwightshih.com. IN A

    ;; ANSWER SECTION:
    www.dwightshih.com. 3600 IN CNAME c.storage.googleapis.com.
    c.storage.googleapis.com. 1055 IN CNAME storage.l.googleusercontent.com.
    storage.l.googleusercontent.com. 229 IN A 64.233.171.128

    ;; Query time: 58 msec
    ;; SERVER: 10.0.1.1#53(10.0.1.1)
    ;; WHEN: Mon Sep 1 16:48:08 2014
    ;; MSG SIZE rcvd: 129

And voilà, your static page should be up.