ogallagher / tejos_textiles

An online arts journal for publishing works in a new medium
MIT License
1 stars 0 forks source link

Get a domain name #26

Closed ogallagher closed 4 years ago

ogallagher commented 4 years ago

After looking up available domain names, probably the best I’ve found are:

DNS providers comparison

domains.google.com = $12/yr ionos.com = $15/yr (with $1 for first year) godaddy.com = $21/yr (with $11/yr first year) dnsimple.com = $50/yr (billed monthly) amazon route 53 = $12/yr

Sendgrid domain setup

Investigate round-robin DNS as a way to have the same domain point to multiple servers and share traffic. EDIT: this should be possible with AWS rt 53.

ogallagher commented 4 years ago

This tutorial covers the different aws components that could be included, including moving the server to EC2 hosting, and using Route 53 DNS.

I purchased both revistatetejos.com and textilesjournal.org, which should take ~3 days to process and update on the DNS, and will cost $24/yr.

ogallagher commented 4 years ago

This guide explains how to set up https on a site (hosted with EC2) behind a custom domain using Certbot.

It seems that trying to keep a server with heroku and point rt 53 to it while supporting https would be possible, but would require an account upgrade in heroku to register an SSL certificate with them. EDIT: I confirmed this just now following this post. I was able to create an ssl cert with certbot, but in the last step of pushing the cert files over to the heroku app...

sudo heroku certs:add .../fullchain.pem .../privkey.pem -a textilesjournal

It failed with this message: You need to be running on either Hobby or Professional dynos to be able to use SNI SSL. Therefore, running the custom domain through to heroku costs $7/server/mo.

ogallagher commented 4 years ago

Now I’ll try to create an EC2 server, route the custom domain to it, and then add https support.

EDIT: I was able to create an EC2 server (with a lot of initial config; enable ports, set .env, install node) and accept http connections via the purchased domain name, but I had to disable the force_https() method– I’m not even sure why that worked in the heroku environment, but in this case my server isn’t listening to port 443, so the redirect to https would just break the connection. In order to support an https connection I think I have to set the server to run on port 443 and provide it the ssl credentials as arguments. To force https there’s an extra step I don’t understand yet (with load balancers?). To enable routing of the root domain (textilesjournal.org, not www.textilesjournal.org), there’s another thing I don’t understand (static S3 site to reroute to EC2?).

ogallagher commented 4 years ago

I followed this tutorial to enable https correctly using express and certbot, passing the ssl certificate to the server on start for identification and encrypting the connection. I also disabled force_https globally, and will rely on the AWS network configuration to force all connections to https.

That same tutorial goes over how to set up automatic certificate renewal, which will be an important reference later.

ogallagher commented 4 years ago

The root domain now successfully routes to the load balancer, which targets the EC2 instance that supports HTTPS (and HTTP, I think). As of now I have a viable way of creating a production-level server with the custom domain (no subdomains necessary)!

https://textilesjournal.org

ogallagher commented 3 years ago

For documentation’s sake, I recently discovered that textilesjournal.com is for sale on the dan.com domain name market. However, the minimum bid is $5000 single purchase, so I’m not taking it.