What is the best solution to use a common domain/subdomain with Jekyll on Heroku and other hosting website? - heroku

I just moved my personal website to Octopress from Drupal. I am hosting it on Heroku and I really don't like the herokuapp.com domain. I already have myname.com domain which I am planning to use with Heroku now for my main website.
The problem is I have some other websites hosted on my hosting service which use databases and other stuff. They were being accessed by project1.myname.com, project2.myname.com etc. I don't want to move them and have a similar subdomain naming thing to access them.
How can achieve this?

If I'm understanding you correctly, it should be easy to do this with your DNS settings. Simply point the DNS "A" records for "myname.com" and "www.myname.com" to Heroku and leave "project1.myname.com" and "project2.myname.com" pointing to your existing provider.

Related

How to share subdomain site using laravel valet?

I'm developing site with subdomain. I am using laravel valet as well So, It's currently look like https://app.portal.test/ in my local environment. I want to share this site using laravel valet sharing site option sharing-sites-via-ngrok. But it's not working. So I guess I want to do something different for sharing with subdomain. Anyone have any idea how to do for valet share for subdomain?
TLDR: You can't
You cant share https://app.portal.test (.test), thats for local only, it doesn't resolve on internet.
If you have public ip (whatsmyip.com) and that ip opens your localhost, then you can create a virtual host that point to that IP but you still need a real domain not test.
Using ngork is best option you have, You can also get a cheap $3 vps and point your domain to it.

How to use a domain name from name.com for a Heroku app?

I have an application running on example.herokuapp.com. No subdomains, no HTTPS, just a basic, read-only application. I also bought my domain name example.com from name.com. How do I link my domain name to the Heroku app?
I found these two questions, but I can't understand them, don't have any idea what DNS, CNAME, A records etc. are..
How to configure DNS records for Name.com and a Heroku app
How to connect my domain bought on name.com with my herokuapp?
I would appreciate a dummy-friendly explanation on how to setup my domain name with my Heroku app.
From this page I understand (guess) I need to use an additional service such as DNSimple or CloudFlare, is this correct? I tried CloudFlare but there is an additional problem that my domain is already linked to 000webhost.com (which I want to remove) via name.com. Anyways, please just tell me what do I need to have in the end :) Also I prefer to use only the free plans, if possible.
Thanks in advance

create php web service and access to the internet

I have recently installed PHP, MySQL Server, and Apache web server. I played around with some PHP scripts locally on the PC to insert some entries to MySQL Database.
Noob question so please be patient with me:
How do I get my web service out to the internet, by self hosting? Say I already have a domain for example mydomain.com How do I make it so that when someone not within my network can access mydomain.com/something and can send some data so my server gets it and do anything with that data?
Webhosting
You have to have some form of webhosting. You pay for hosting and you can upload your PHP files to their servers. They will usually also have database servers you can use.
Your domain name has to point to those servers via DNS so the internet can reach your application. I'd suggest you search the internet for popular hosts that provide the tools your need for this.
Self hosting
Another possibility is to open your network up to the world, but this is not recommended unless you have network administration experience due the security trouble that comes with it.
In short: forward a port through your router to the machine running your application. The website portforward.com has instructions on how to do this but keep in mind that misconfiguration could lead to vulnerabilities in your network.
In order to make you site public
1. you need host
2. you need domain
there are bunch of hosting sites you should get one first.
This link explains very well about self hosting
https://www.boutell.com/newfaq/creating/hostmyown.html

Have static site on Amazon S3 and Cloudfront, how to add sub-domain hosted elsewhere?

I have a site with a root domain (mysite.com) as a jekyll static page, hosted on Amazon S3 and Cloudfront. I'd like to add a sub-domain such as purchase.mysite.com which would be located on another provider such as Heroku. The intention here is to have a landing page backed with Amazons CDN and the services somewhere else as at that point I don't think the speed is as important. Has anyone else gone this route? How and what was involved with it's implementation? Is there a better way to accomplish the same goal?
This setup is pretty common I'd imagine.
You need to create a subdomain on your DNS using a CNAME record type pointing at the .herokuapp.com address that Heroku will give your application and then add the custom domain to your Heroku application.

Production redirect loop error on root domain, but not with www

I'd like when a user types the domain YOURSITE.com to not go into a loop and crash. I've searched for answers for a couple days now and can't seem to find the exact one.
Error from chrome: This webpage has a redirect loop - The webpage at http://YOURSITE.com/ >has resulted in too many redirects. Clearing your cookies for this site or allowing third->party cookies may fix the problem. If not, it is possibly a server configuration issue and >not a problem with your computer.
Background:
Rails 3.2.14 App with Ruby 2.0.0
Domain bought with godaddy
Hosting on Heroku with both domains setup www.YOURSITE.com and YOURSITE.com
Using AWS with route 53 and S3.
Let me know what relevant code you need to help or if this is something that is being caused by AWS or the like. I've tried an reversed several different things via my code, but can't seem to find anything that works.
you should log into your Heroku dashboard, click on the app and then click on the "Production Check" button. This will help you check for DNS issues among other.
Check your DNS Zone file with godaddy. How are you redirecting the sub domain www to the host domain?
On your rails app, how is your route.rb file handling the incoming traffic? do you have any redirection there?
Hope that helps..
There is a very good write up that goes through configuration settings between AWS, the domain registrar (in my case godaddy), and heroku here: https://devcenter.heroku.com/articles/route-53#naked-root-domain I used this originally when I set up my site.
I wish I could say I know what the problem was, but I'm not totally sure what it was. My guess is that it had to do with APEX domains being unsupported by AWS and/or Heroku, and therefore I needed not to try to redirect. Here's the settings that worked for me:
Godaddy domain mysite.com, transferred my DNS stuff to AWS (I had done that prior to the problem)
Heroku: you can either use the CL or you can access the settings for your app online. In either situation I set up my domains to be mysite.com and www.mysite.com
AWS: This is a little trickier. You need to make sure the settings for Route 53 and S3 are exactly like in the tutorial link above. Your mysite.com bucket in S3 must redirect to www.mysite.com.
This isn't ideal and there are probably ways to get around this using different companies for hosting/DNS services, but with the Heroku/AWS combo this is what I had to do to stop the redirect loop.

Resources