Haiku via Times Haiku

Haiku via Times Haiku

We use Meteorite to manage meteor packages and control the version of meteor and being deployed to Heroku.

These instructions assume the use of a custom domain (i.e. www.example.com) and securing the domain with SSL. 

Part 1: Create the SSL Certificate

  1. Acquire SSL Certificate from SSL provider (these instructions are based on the Digicert SSL provider, but are roughly the same for everyone)
  2. On a computer with openssl installed, create the private key
    • $ openssl genrsa 2048 > private-key.pem
  3. Create the csr for Digicert (fill in the appropriate fields when asked) 
    • openssl req -new -key private-key.pem -out csr.pem
      • Country:
      • State:
      • City: 
      • Org name: 
      • OU: 
      • Common name: (the FQDN for the domain being secured with SSL) 
        • i.e. www.example.com
      • Email address: 
  4. Login to Digicert
  5. From reissue options, choose duplicate
  6. Copy the output of the csr.pem file into the CSR box
  7. Specify OTHER as the certificate output
  8. Enter the name of the subdomain(s) to secure at the bottom of the form
  9. Click process duplicate wildcard cert
  10. Refresh, and click download on the duplicate certificate created.
  11. Choose Other format, individual crts for the download format
  12. Combine the root and the domain certificate into one file
    • i.e.  $ cat star_foo_io.crt DigiCertCA.crt > ~/server.crt

Part 2: Creating a new Heroku app to host a meteor app

  1. Login to Heroku from the toolbelt (cli)
    • $ heroku login
  2. Create meteor app using the meterorite custom buildpack
  3. Install the SSL Endpoint add-on (beware, this is a $20/month charge)
    •  $ heroku addons:add ssl --app foobar
  4. Add the SSL certificate created above to your application
    • $ heroku certs:add server.crt private-key.key --app foobar
    • This command will output a new Heroku application url with SSL
  5. Add the custom domain to each Heroku application URL (derived from the previous step)
  6. Add MONGOHQ_URL and ROOT_URL config variables (aka environmental variables) to the Heroku app. 
    • The MONGOHQ_URL and and ROOT_URL environment variables are required to run a meteor app on top of node.js. The MONGOHQ_URL could reference any mongodb instance, this just happens to be the name used in the meteorite buildpack.  
      • $ heroku config:add MONGOHQ_URL= mongodb://<user>:<password>@some.mongo.com/foobar --app foobar
      • $ heroku config:add ROOT_URL=https://www.example.com --app foobar
  7. Push your meteor code to the Heroku app's git repository, watch it build. 
  8. Do a Snoopy dance.