Sunday, August 24, 2014

Forward Naked domains to Openshift for FREE

How to attach a domain name to OpenShift or any PaaS account ?

1. Create a new app ex in OpenShift - app_name-domain_name.rhcloud.com
2. Get a domain from Godaddy.
3. Signup for a free account for CloudFlare


CloudFlare

1. Add a website, by specifying the domain name - example.com

2. In the DNS settings, check if these two entries are there - if not create them manually
  • www points to example.com - type CNAME
  • example.com points to app_name-domain_name.rhcloud.com - type CNAME
3. Delete A level record from the list

4. CloudFlare now shows you two name servers.


GoDaddy

1. Delete the existing nameservers provided by Godaddy in Godaddy's control panel, in the domain settings for example.com

2. Add the two nameservers provided by CloudFlare to domain settings of example.com in GoDaddy

3. Check if domain forwarding is disabled or off. It should be disable or off by default


OpenShift Client Tools - Locally


1. Install the rhc client tools for openshift, if you haven't and set it up, by following the instructions here

2. After Installation execute these commands
  • rhc alias add app_name example.com
  • rhc alias add app_name www.example.com