Use Heroku with register.com - heroku

I have a free app hosted on Heroku, and a domain on register.com. How can I connect the two? I am OK with using any service or addon, as long as it is free. The only stipulation is that I can not spend ANY money. I also want to be able to have an m subdomain for a mobile site. Thanks

Follow the instructions to configure custom domains.
You just need to install the free custom_domains addon.
$ heroku addons:add custom_domains
Then add the domains
$ heroku domains:add www.example.com
Then, don't forget to update the DNS settings on your domain provider to point to Heroku IP.

Related

How to Provision APIs on Heroku

Please forgive my question. I am a complete newbie at this.
I have built an API in spring boot and I have pushed it to heroku.
I have a custom domain for my website already as www.mywebsite.com
I want to provision my apis under this domain as well as api.mywebsite.com
How can I achieve this on heroku?
Any help on how to go about this would be sincerely appreciated.
Thanks
I will assume that you have full access to the Namecheap account.
You have 2 options:
A. Use Heroku CLI
B. Use Heroku interface (Web application)
A) Let's go through the process with Heroku CLI.
Make sure that you have the Heroku CLI installed (macOS: brew install heroku, Ubuntu: apt install heroku, etc.)
Add your domain using the command heroku domains:add api.website.com (if you have multiple apps, don't forget at the end of the command to add --app name-of-your-heroku-app.
Heroku will generate for you a DNS target for the custom domain you added at step 2. Run heroku domains and copy the DNS target (The DNS target looks like this: whispering-willow-5678.herokudns.com)
Open your Namecheap domain settings and add a CNAME (Name: "api" and Target: the DNS target provided by Heroku).
Wait few minutes up to few hours.
B) If you want to use Heroku Interface / Webapplications.
Open your app on www.herokuapp.com
Go to "Settings" tab
Scroll down to "Domains"
Click on "Add domains"
Add your subdomain (api.website.com)
Heroku will generate for you a DNS Target
Navigate to your domain settings in Namecheap and create a new CNAME using your subdomain (e.g. api) as name and the DNS target provided by Heroku as target.
You can find all the details in Custom Domain Names for Apps Heroku Documentation

How to implenent NameCheap DNS with Netlify and Heroku

So I want to host my front-end React app on Netlify and I want it to be at www.mydomainname.com.
I also want to host my back-end on Heroku and I want it to be at api.mydomainname.com.
The problem is that if I set NameCheap DNS settings to use NamCheapDNS I can point it to Heroku, but I can't find a way to point it to Netlify as well since Netlify tells me to set NameCheap DNS to Custom DNS and I should point it to Netlify DNS with dns1.p07.nsone.net from 1 to 4.
Is there a way to have front-end on Netlify and back-end on Heroku, or at the end I have to transfer my React front-end to Heroku as well? And would that use the extra dyno or not?
Thanks!
In the end, I added dns1.p04.nsone.net. as the NS Record for "www" host in the Advanced DNS tab under my domain name.
Belatedly,
You can add a CNAME in Netlify's DNS records that points to Heroku's DNS. It looks like this
Record Type=CNAME
Name=api
Value=asdfasfd.herokudns.com
TTL=(blank)

GoDaddy domain not pointing to Heroku app

I'm trying to point my GoDaddy domain to Heroku app. I followed the steps given here: https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain but I'm unable to access my Heroku app. Here are my DNS records settings:
Can someone tell me where I'm going wrong?
cname only allow you to point subdomain, so this case you should be able to see www subdomain pointed to Heroku, can you try to remove the A record.
I would recommend using DNS service like DNSimple/Cloudflare or in case you don't want to go out of Heroku you can try pointDNS

heroku and domain name conventions

(tried on Server fault, so going to try here)
Hi I recently setup my octopress blog at http://davidmjohnson.me. This domain works fine, but when I try http://www.davidmjohnson.me I get a "heroku no app found." Why is the www not working. Would really appreciate an explanation. I bought my domain name at dnsimple. Do I need to add a redirect from "http://www.dav..." to just "http://dav..." ?
Thanks
I'm guessing you need to configure this domain (and any subdomain) in the heroku CLI application (equiv. of ssh-ing into the machine and changing the nginx/apache location/virtualhost configuration).
I see they have an entry about this in their reference:
https://devcenter.heroku.com/articles/custom-domains
To elaborate a bit from the documentation:
Subdomains ( www.mydomain.com)
For each subdomain you want to setup configure your DNS provider using
a CNAME record pointing the subdomain to the applicable Heroku
hostname.
If the app is on Cedar, then CNAME the subdomain to myapp.herokuapp.com
If Bamboo, then myapp.heroku.com
In DNSimple a CNAME
record entry for a Cedar app would look like:
You can confirm that your DNS is configured correctly with the host
command:
$ host www.example.com
www.example.com is an alias for myapp.herokuapp.com.
myapp.herokuapp.com is an alias for ar.herokuapp.com.
ar.herokuapp.com is an alias for argon-stack-1879049447.us-east-1.elb.amazonaws.com.
argon-stack-1879049447.us-east-1.elb.amazonaws.com has address 107.20.157.144
...
Actually, it should really be the other way around. It is much better practice to point CNAMEs at Heroku apps, since Heroku apps have no real "static" IP. Since naked domains need an A-record, pointing a naked domain to a Heroku app makes everything much less stable. So the best practice is to forward your naked domain to a "www" subdomain, and then point the "www" CNAME to your Heroku app.
Heroku goes into detail about this here.

Is it possible to whitelist Heroku apps?

I have a Heroku application that binds with a telco sms gateway via SMPP
The telco guys need to whitelist IPs for my app to connect.
I am aware of the new addon proximo, but it's just insanely priced. So that option is out.
Is there a subnet or a list of IPs that I can get whitelisted and is there a guarantee that all requests from my app will originate from tose IPs?
I found this https://api.heroku.com/vendor/logplex/allowlist.
Is that only for syslog or all apps make a request from one of those IPs?
Thanks
There is now a Heroku add-on that does this called Proximo: https://addons.heroku.com/proximo
The Heroku docs specifically mention how dynos don't have static IP addresses. Even when using custom domains it looks like they want you to point to a CNAME record rather than an IP address. So if you need a static IP it looks like Proximo is your best bet.
Would it be possible to use an API token to authenticate your app with the sms gateway, similar to the way the blitz.ip plugin works with heroku? Then you might not need to use a static IP whitelist.
This question looks to be doing something similar to you, and this answer suggests using a hosted VPN service. Would that work?
Heroku now has Private Spaces which is what you are looking for:
https://www.heroku.com/private-spaces
Another Heroku addon option is Quotaguard , in beta, free for now.
Answering my own question. Even though an external VPN or the proximo addon are a solution in case you want to whitelist a Heroku app, I have decided to go for the simpler option and host the SMPP binding service of my app on ec2 using an Elastic IP
You can host a proxy yourself using Dockhero Heroku add-on - https://dockhero.io/ - which has a static IP (AWS elastic IP).
Install the add-on and the CLI plugin:
$ heroku addons:create dockhero
$ heroku plugins:install dockhero
Wait until the provisioning is done and get DOCKHERO_HOST environment variable
$ heroku dh:wait
$ heroku config:get DOCKHERO_HOST
--> e.g. dockhero-spherical-42047.dockhero.io
Create dockhero-compose.yml file with the following contents:
version: "2"
services:
proxy:
image: tecnativa/tcp-proxy
environment:
LISTEN: ":80"
TALK: "www.wikipedia.org:80"
ports:
- "80:80"
Here www.wikipedia.org:80 is the server which you build a proxy for.
Find more about the syntax in https://docs.docker.com/compose/compose-file/compose-file-v2/
Run this stack in the cloud using Dockhero CLI:
$ heroku dh:compose up -d
Any requests to the host from DOCKHERO_HOST Heroku config var will now be proxied according to your dockhero-compose.yml
$ curl http://dockhero-spherical-42047.dockhero.io/
--> <response from www.wikipedia.org>
IMPORTANT: as of writing this, dockhero.io is in Beta and available for free. When switching to production, the assigned IP may be changed after a prior notification.
Fixie is another alternative add-on not mentioned here. Free plan with 500 requests per month. Requires some adjustments in code and heroku app to be in us region (or you can migrate it: Migrating an Application to Another Region). Worked for me.

Resources