Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect Google domain to Google Cloud Bucket

I'm trying to get my Google domain to connect to my Google Cloud bucket. I have followed all the instructions carefully on this page:

https://cloud.google.com/storage/docs/hosting-static-website

...such as entering the DNS numbers, making the files public, etc. And the domain is verified since it is a Google domain. But no matter what I do, I can't get the domain to serve up the files in the bucket. Any help would be appreciated.

like image 620
classicsbro Avatar asked Nov 22 '16 07:11

classicsbro


1 Answers

Create a CNAME alias that points to c.storage.googleapis.com. is where google cloud documentation does not give much information.

Follow this steps. I will take an example of www.mydomain.com as a sample domain.

  1. Goto https://domains.google.com

  2. Select Configure DNS.

  3. Goto Custom Resource Records section at the bottom

  4. Put www.mydomain.com(your domain) in the left input box.

  5. Select CNAME in the drop down. c.storage.googleapis.com as DATA. Hit save. The name would come as www. Dont worry about that.

  6. Goto Storage of google cloud. Create a new bucket. Give the bucket name same as the domain name ie www.mydomain.com here.

  7. Upload the files in the bucket.

  8. Go inside the bucket and give permission to the pages as share publicly (https://cloud.google.com/storage/docs/access-control/making-data-public#buckets).

  9. Goto website configuration(3 dots towards the right) in the bucket list. Give the name of the home page to Main Page. For example index.html. Put the error page in the 404 not found input box. Hit save and you are done.

  10. Try running your website and see if you are able to hit the page.

If you are getting error as DNS not found then there is some issue with CNAME linking.

If you are geting error from the bucket such as permission that means that your DNS is connected to bucket but there are some permission issues with the files.

like image 121
John Kuriakose Avatar answered Oct 26 '22 08:10

John Kuriakose