How to avoid .s3-website-us-east-1.amazonaws.com/ in the URL? - amazon-web-services

I'm using static site generator cactusformac.com and I just hit deploy and I was hoping the url would be ONLY beccashayne.com but instead it is http://beccashayne.com.s3-website-us-east-1.amazonaws.com/.
How do I get rid of the .s3-website-us-east-1.amazonaws.com/ and have just beccashayne.com? Or do I need to manually upload all of the content to an FTP thing like cyberduck?
Any advice for a super not advanced developer is helpful I have no idea what I'm doing and all of the docs in AWS are really heavy.

Use Route53 and register your domain beccashyne.com then in the Route53 then the following step:
DNS management click on your Hosted zones, click on your domain name
Click on Create Record Set
In the "Create Record Set" leave your Name blank; Type A - IPv4 address; Alias = Yes; Alias Target: select your S3 Endpoint should be something like "s3-website-us-east-1.amazonaws.com" and that's it!

Related

Records for DNS when setting server side TAG Manager with Cloudflare

I´m setting CAPI with the TAG Manager side. I´m not sure what settings to use for the subdomain using the DNS records provided by Google Cloud Platform in Cloudflare. I have all set up, but not sure about this part.
I use Cloudflare, the A and AAAA records should use the # for the main domain or the subdomian.maindomain.com as an alias? For example
type A
name subdomian.maindomain.com
Content 216.458.25.15
or
type A
name maindomain.com
Content 216.458.25.15
Thanks in advance!
Im really struggling with this too. The google app engine doesnt seem to register the certificate.
This is what my DNS entries look like. Is it normal for the google app engine to take MORe than 2 hours to register the cert?
enter image description here

How does one serve multiple static pages from a single S3 bucket?

Let's assume one has an Amazon S3 bucket example.com configured for static hosting. In the configuration, the console allows setting an index file and an optional error file. But I'm struggling to figure out how to add another page to the site. I thought this would be straight forward but I cannot find the answer in the official documentation or on the internet.
If I want to add one more page to the static site (e.g. example.com/page2) and there is a page2.html file already in the S3 bucket at the root, where is the correct place to make this routing configuration? Can it be done through the S3 console? Or does it need to be configured through some kind of a DNS record? As a further complication, this needs to also work with and without the www in the URL.
On the DNS side I currently have the following configuration:
CNAME | WWW | www.example.com.s3-website-east-1.amazonaws.com | TTL 30 min
URL Redirect Record | # | http://www.example.com unmasked
Are you trying to access the page at example.com/page2.html or example.com/page2
If you want to access the page at example.com/page2 then create a 'folder' called page2 off the root and in that folder put a file called index.html
If you want to use example.com/page2.html, then create a file called page2.html and put it in the 'root' of the bucket.
Simply create a file called page2.html. It will be accessible via example.com/page2.html.
No routing configuration is required.
The index file alias is only used if no page is specified (eg they go to example.com/).
As for mapping www.example.com to example.com, you would create another bucket with the name www.example.com and use "Redirect requests" to point back to example.com. (If using a CNAME works for you, that's probably easier, but test it first to see if it functions as expected. See: Mapping naked domain (www.domain.com) to static website which is saved in S3)
See: Configuring a static website using a custom domain registered with Route 53 (Follow the manual steps rather than automating via CloudFormation, so you can better understand what has been configured)

AWS API GateWay can't have multiple paths?

I just got my custom domain name setup via AWS API Gateway, and now I have several domain names all routing to one lambda function. which just serves a webpage.
The setup looks like this:
And I have several of these with different domains that I want all to serve the same content.
Now, I'd like to add another path like /getdata or something which will just serve some data from a database instead of serving static HTML.
But when I try to add another path I get this error:
Error
Only one base path mapping is allowed if the base path is empty.
How can I have a single domain with multiple paths then?
I tried just using the wildcard path: *, and that works for multiple paths like /test or /getdata, but it doesn't work with just the domain name, and I can't tell every single user to make sure to type something in like /home everytime
Ahh I figured it out!
So, unfortunately, the page that shows you the custom domains is not where you need to be making your routes.
The correct procedure is to create an API (or use an existing API, and modify the resources) and give it a proxy resource, and a plain GET method that originates from the root path.
First, go to your API GateWay console, and create a new API.
Then once you give it a name, and choose the type (regional, or edge), it will show you the resources page
Here, you will do 2 things: Create a catch all proxy resource, and also a get resource to the root path.
Step 1: Make a catch all proxy resource:
Click Actions, and choose Create Resource
On the wizard, click Configure as proxy, and give it a name. Leave the resource path as it is. Then click create resource. The {proxy+} is notation that tells AWS that this resource should accept any path that has anything after the /. This means /test will work as well as /test/1/2/3/etc. However just / alone will not work!
Next, it will take you to this screen where you choose your integration type. We want lambda, which is the default. Make sure to select the correct region, for me the default was the right one. Then start typing in your lambda function name, and it should dynamically pop up a list of your lambda functions. select the one that you want for your application. If that doesn't work, you can copy and paste your lambda ARN from the lambda function console. Click Save.
Step 2: Make a get resource for the root path
Click the root slash at the top, right under where it says resources. Then click actions, and choose Create Method. It will pop up a little selection thing under the root slash, and there you should select GET, and then click the little checkmark.
Here, make sure to check Use Lambda Proxy Integration, and then the rest of this form should be the same as the last one you did. Just select your region, and your lambda function, and click Save.
Step 3: Deploy
Once that's done, go to actions, and choose Deploy API, give it a name for a stage, and some description, and then you are ready to attach this API to your custom domain.
Step 4: Attach
On the left tab scroll down to where it says Custom Domain Names, and create a new domain name (or attach it to an existing one if you have it)
Enter your domain name, and choose regional or edge. Then choose your certificate (there are many good guides for how to make a certificate through AWS)
Once you click save, it will look something like this:
Click Show Base Path Mappings, and then Edit.
In the path field just leave a slash, in the Destination field, choose from the dropdown the API that you just deployed. And on the right, select the stage that you made when you deployed your API.
Lastly, it will sit at initializing for a while, so while you wait for that, remember that you need to make a route53 record set for this domain, and map it to the cloudfront target URL that the API GateWay gave us. This target url looks like: www.u10dsa3s5iovdk.cloudfront.net. Copy that, and go to Route 53, Choose the hosted zone for your domain. Create a record set, and give it the same name as the domain you just created, so if you made www.example.com, in the name field of Route 53 you need to type in www. or if you made test.example.com you need to type in test. Then choose Alias: Yes, and for the Alias Target, paste in the cloudfront url from API GateWay.
When the custom domain name is done initializing, you can make calls to www.example.com as well as www.example.com/anything/else/you/want/to/put/here
Hope this helps anyone who was stuck as long as I was. Please let me know if there's anything I missed, or if something is inaccurate.
In this case you need to configure a path different to "/" for each api you need to serve through custom domain. AWS Api Gateway don't let you to serve several api into the same custom domain if you serve at least one api with no base path.

I hosted Opencart on openshift, But after CNAME mapping, Application is showing 404 Error

I have successfully deployed opencart on openshift, and It is running properly with the url provided by the openshift, But when I have mapped that URL with the CNAME in my domain name, It is showing Error that App is not found.
Can someone please help me for the same.
You may need to set your alias to the domain name you have chosen. You can do this via the web console. Aliases are what allow you to use your own domain names for your applications on OpenShift.
It's a 2 step process
(1) Set up the CNAME record with your DNS provider
it sounds like you have already done this at your DNS provider
(2) Configure OpenShift to use your alias
so from the web console, go to your application's main page by clicking on Settings icon then click on "Change" link to enter your custom domain name e.g. www.example.com or something.example.com.
Let us know if that works,
Diane

How can I set the CNAME record on network solutions for my heroku app?

I bought a domain name on network solutions. I have a working app at blooming-summer-8571.herokuapp.com. I want my domain name on network solutions to point to this app. So in the CNAME records. It has a box for alias, ttl, and a drop down menu for # (none) or www . Then there is another option you can check (instead of the drop down menu) to fill out an other host name.
So which is the alias? Should I check other host name and put in the heroku app's url? This is all done under my DNS settings for the domain I purchased so I assume that I don't have to fill it out anywhere? The online resources I have found are rather unhelpful.
I just went through the same thing.
Log in to Network Solutions (Select manage my domains when you log in)
Click "Manage" on the domain you want to point to Heroku
Click "Edit Advanced DNS Records"
Click "Edit A Records" and clear the IP addresses for "www" and "* (All Others)". Put 205.178.189.129 in for "# (None)" then click continue
Click "Edit CName Records"
put "www" in for the Alias. And "YOURAPP.herokuapp.com" in for the "Other Host" field. Make sure the radio button for "Other Host" is selected. Then click continue.
IF you get an error claiming you already have an A record for www then log out of Network Solutions, log back in, and try again.
This will point www.YOURDOMAIN.com to YOURAPP.herokuapp.com
To make sure it worked (give it some time before checking) open up a terminal window and type :
host www.YOURDOMAIN.com
It should respond with something like ..
www.YOURDOMAIN.com is an alias for YOURAPP.herokuapp.com.
Resources:
https://devcenter.heroku.com/articles/custom-domains#domain-precedence
http://www.networksolutions.com/support/how-to-forward-your-network-solutions-domain-name-to-a-free-blog-service/
Just discovered that this page is extremely helpful for this:
http://www.networksolutions.com/support/how-to-forward-your-network-solutions-domain-name-to-a-free-blog-service/
Basically you just need to delete all your A records, and point the # one to the IP 205.178.189.129. Then, as long as you have a valid CNAME record for 'www' (in the case of Heroku, it'd point to your app's heroku URL), Network Solutions will correctly forward all traffic to your www CNAME.
A CNAME (Canonical Name) record is only for domains that you can control and points the canonical name to the correct domain name. What you need to do is point your domain to your Heroku app by following the steps in the following: https://devcenter.heroku.com/articles/custom-domains
The article does state to use CNAME to point to blooming-summer-8571.herokuapp.com (cedar server)