I’ve been playing around with Firefox’s open web app designs recently. I hadn’t quite realised before that if you have Firefox on Android and your PC, you can run their webapps on FirefoxOS, Android and the desktop, which is pretty impressive. Their payment and push notification infrastructure is exciting too.
One small gotcha is that when you write a webapp, it’s better if you host it on its own individual subdomain (for reasons! Security reasons!).
As it turns out, if you can get your DNS provider to add a line like this to your DNS zone file:
*.apps.example.com 36000 CNAME www.example.com
…you can add something like this to your Apache configuration, and create an infinite number of apps in their own domains (so that http://foo.apps.example.com/ would map to pages stored in /var/www/apps/foo )
You’ll need to enable the mod_vhost_alias module, which you can do in standard Ubuntu and Debian by typing sudo a2enmod vhost_alias