Wednesday, February 29, 2012

Dropbox + Google Apps Engine + Google Apps = Free Web Hosting

Each Dropbox account has a Public folder with a fixed base URL from which one can make files publically available on the web. Any file can be served, including static HTML files. So why not use Dropbox to host a simple website? I'll tell you why: because the base URL is a sloppy mess which makes straight domain forwarding impossible.

This dude has a pretty cool workaround--use Google App Engine to host a URL-rewriting service specially configured to proxy requests from the app to Dropbox. He calls it DropbProx (a specific version of the more complete mirror proxy, mirrorrr). And since the GAE application gets a sweet URL in the form appname.appspot.com, it's ripe for domain forwarding.

In order to transfer the application files to your GAE account, you'll need to install the Google App Engine SDK. If you're a Windows user, I suggest the SDK for Python--which requires, of course, the Python runtime.  Here is a straight-forward tutorial (pics and vid included) on installing the SDK and deploying an application to GAE.

Once the app is up and running and forwarding requests from your app URL to your Dropbox URL, go to the GAE dashboard under Administration >> Application Settings >> Domain Setup. From here, you can "host" your application under your Google Apps domain.

Now head over to the Google Apps dashboard, and under Settings, your app should be listed in the Services column as "your-app-id (App Engine)". Follow the steps to map the www subdomain to your-app-id.appspot.com. The final step will be access your domain name provider and add a CNAME record to your DNS settings that will map www to ghs.google.com. For bonus points, have your DNS provider map your naked domain to the www subdomain so that yourdomain.com and www.yourdomain.com both send users to your website.

A final caveat: the Dropbox public folder is not an actual web server. So it won't assume a call to an open-ended URL will default to index.html, index.htm, index.php, etc. That logic would have to built into the proxy application. Still, not too shabby for free web hosting.

No comments:

Post a Comment