Adding Domain Name to OpenShift WordPress, Unlike IaaS Can Be Challenging. We Can Use Free CloudFlare to Make the Process of Pointing Easier. Actually we talked about Pointing Naked Domains to CNAME before; WordPress Development needs checking of the Nightly Builds, one can use OpenShift for this purpose. PaaS, basically can be quite painful for who are not developers.
Why Adding Domain Name to OpenShift WordPress is Difficult?
There is no A record or AAAA record. Traditionally we need to validate our domains against a specific server’s A record or AAAA record. For example, you can perform a nslookup -debug domainname.tld
command in Terminal App (on Linux or Mac) and we will get result like this (Rackspace Cloud DNS) :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ? ~ nslookup -debug thecustomizewindows.com Server:220.226.6.104 Address:220.226.6.104#53 ------------ QUESTIONS: thecustomizewindows.com, type = A, class = IN ANSWERS: -> thecustomizewindows.com internet address = 192.237.225.97 ttl = 111111 AUTHORITY RECORDS: -> thecustomizewindows.com nameserver = ns.rackspace.com. ttl = 158516 -> thecustomizewindows.com nameserver = ns2.rackspace.com. ttl = 158516 ADDITIONAL RECORDS: -> ns.rackspace.com internet address = 69.20.95.4 ttl = 26157 -> ns2.rackspace.com internet address = 65.61.188.4 ttl = 49524 ------------ Non-authoritative answer: Name:thecustomizewindows.com Address: 192.237.225.97 |
Take that the IP 192.237.225.97
is of a server, not loadbalancer. You can see, there is no CNAME record. If you run the command for a subdomain of the domain, you’ll get like this (Rackspace Cloud DNS) :
---
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | ? ~ nslookup -debug cloud.thecustomizewindows.com Server:220.226.100.40 Address:220.226.100.40#53 ------------ QUESTIONS: cloud.thecustomizewindows.com, type = A, class = IN ANSWERS: -> cloud.thecustomizewindows.com canonical name = f4f9597874d3d77289b7-e78c55da223d54933c14da1090eadabf.r71.cf2.rackcdn.com. ttl = 300 -> f4f9597874d3d77289b7-e78c55da223d54933c14da1090eadabf.r71.cf2.rackcdn.com canonical name = a71.rackcdn.com. ttl = 300 -> a71.rackcdn.com canonical name = a71.rackcdn.com.mdc.edgesuite.net. ttl = 300 -> a71.rackcdn.com.mdc.edgesuite.net canonical name = a73.dscg10.akamai.net. ttl = 193 -> a73.dscg10.akamai.net internet address = 46.33.68.87 ttl = 20 -> a73.dscg10.akamai.net internet address = 46.33.68.135 ttl = 20 AUTHORITY RECORDS: -> dscg10.akamai.net nameserver = n1dscg10.akamai.net. ttl = 4635 -> dscg10.akamai.net nameserver = n5dscg10.akamai.net. ttl = 4635 -> dscg10.akamai.net nameserver = n2dscg10.akamai.net. ttl = 4635 -> dscg10.akamai.net nameserver = a1dscg10.akamai.net. ttl = 4635 -> dscg10.akamai.net nameserver = a0dscg10.akamai.net. ttl = 4635 -> dscg10.akamai.net nameserver = n3dscg10.akamai.net. ttl = 4635 -> dscg10.akamai.net nameserver = n4dscg10.akamai.net. ttl = 4635 -> dscg10.akamai.net nameserver = n0dscg10.akamai.net. ttl = 4635 ADDITIONAL RECORDS: -> a0dscg10.akamai.net has AAAA address 2a02:26f0:32:f000:f50b:192b:c5c9:7d1c ttl = 8281 -> a1dscg10.akamai.net has AAAA address 2a02:26f0:32:f000:f50a:192b:c5c9:7d1c ttl = 9221 ------------ Non-authoritative answer: cloud.thecustomizewindows.comcanonical name = f4f9597874d3d77289b7-e78c55da223d54933c14da1090eadabf.r71.cf2.rackcdn.com. f4f9597874d3d77289b7-e78c55da223d54933c14da1090eadabf.r71.cf2.rackcdn.comcanonical name = a71.rackcdn.com. a71.rackcdn.comcanonical name = a71.rackcdn.com.mdc.edgesuite.net. a71.rackcdn.com.mdc.edgesuite.netcanonical name = a73.dscg10.akamai.net. Name:a73.dscg10.akamai.net Address: 46.33.68.87 Name:a73.dscg10.akamai.net Address: 46.33.68.135 |
We have NOT assigned A record against the subdomain but pointed towards Rackspace Cloud Files using CNAME, which is clearly shown as canonical name
. This is one of the reason why with only CNAME the problem happens in case of PaaS.
Secondly, WordPress is never very easy on the coding part. As the installation usually done using scripts with OpenShift’s subdomain name; in the database the URL remains of OpenShift’s subdomain name. We need to edit the wp-config.php
again :
1 | http://codex.wordpress.org/Editing_wp-config.php |
We will not suggest to use Free OpenShift WordPress more than for developmental purpose – there is limitations in free account, with paid account may be you’ll get more official help. However, we will describe the DNS Pointing for Free OpenShift PaaS hosted WordPress.
Steps for Adding Domain Name to OpenShift WordPress
First create a free account on CloudFlare. By now, possibly you have registered a domain via GoDaddy, NameCheap or whatever it is. The second provider is known as Domain Register. The change in Name Server from Domain Register’s account is the final and decisive where the website will point towards. Login to CloudFlare and add the domain. It will scan and provide you custom name servers (two in number). In second step, change the Name Server set from Domain Register’s account (GoDaddy, NameCheap or whatever…).
Now, on CloudFlare account, you need to do some changes :
Delete all the records. Add new records freshly. You’ll add CNAME record against yourdomain.com
(not with www). CloudFlare will give warning. As CNAME record, you’ll add the OpenShift App’s URL. WWW record will be added automatically.
We are showing you a record of a visitor of our website :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ? ~ nslookup -debug yureindica.com Server:220.226.6.104 Address:220.226.6.104#53 ------------ QUESTIONS: yureindica.com, type = A, class = IN ANSWERS: -> yureindica.com internet address = 141.101.116.77 ttl = 300 -> yureindica.com internet address = 141.101.117.77 ttl = 300 AUTHORITY RECORDS: -> yureindica.com nameserver = ben.ns.cloudflare.com. ttl = 86510 -> yureindica.com nameserver = uma.ns.cloudflare.com. ttl = 86510 ADDITIONAL RECORDS: ------------ Non-authoritative answer: Name:yureindica.com Address: 141.101.116.77 Name:yureindica.com Address: 141.101.117.77 |
ben.ns.cloudflare.com
and uma.ns.cloudflare.com
was the custom name server, we added it to Domain Register’s account (GoDaddy). We deleted A Record and added only CNAME. Clouflare mask the CNAME to full. However the problem starts as the App was installed with OpenShift’s URL. So, technically we should update the URL from WordPress Admin panel (that is what we do if WordPress is installed using IP address on full server) and use Search and Replace Plugin to modify towards new url.
Yure Antunes Fernandes is the OpenShift WordPress user and our website’s visitor. We helped him for the CNAME part. He added some more points to solve some issues, you should edit the wp-config.php
:
1 2 3 | // Add these define ('FORCE_SSL_ADMIN', false); define ('CONCATENATE_SCRIPTS', false); |
These what we got from feedback from the real users. It is painful, but basically all are free which otherwise would cost you minimum $30 per month.
Tagged With editing wordpress com cname www for godaddy domain , nslookup rackcdn com , openshift add domain name