So, I've spent about 5 days searching for an answer here and on Google Docs, including having one of their support people help me. My domain still doesn't resolve to the website.
For the record, the website works if I use the ugly url (http://storage.googleapis.com/7thgradeplay.org/index.html).
I have transferred the domain to google domains, days ago.
I have verified the domain with Google Search Console. Billing is enabled and accruing. Public_html is set on all files and folders.
I am using Google Domains name servers. I am not using Google Cloud DNS.
Per Google support:
Synthetic Records: 302 redirect #.7thegradeplay.org to www.7thgradeplay.org
Custom Resource Records: www CNAME 7thegradeplay.org
Does this matter? storage bucket name is 7thegradeplay.org.
I think that's about all the config I've done.
All of these changes were done on Friday (3 days ago), and I still get a 404 error when I try to go to the website. I have followed the instructions and tried to troubleshoot with these pages:
https://cloud.google.com/dns/troubleshooting
https://cloud.google.com/storage/docs/hosting-static-website
The only thing I varied was the name of the bucket in storage. I used a bucket name without the leading 'www.' Please don't tell me this is all it takes to break it.
All help is appreciated.
P.S. I added a bucket called www.7thegradeplay.org with all the same files. Waited 15 minutes. still 404 error.
P.P.S. I found an answer, but it didn't work: Connect Google domain to Google Cloud Bucket.
I will retry step #5 in the PPS above tomorrow, after the PS change has had time to 'stew'.
Again, any help is appreciated.
Your bucket name needs to match the URL exactly, so if you're visiting www.7thgradeplay.org, the bucket also needs to be named www.7thgradeplay.org.
Similarly, the DNS record for "www.7thgradeplay.org" must be a CNAME to "c.storage.googleapis.com.".
Checking DNS, I see a CNAME from "wwww.7thgradeplay.org" to "7thgradeplay.org". It needs to be "c.storage.googleapis.com." If you've already set that, you may need to wait a while for it to percolate. DNS can be slow to update.
Follow below steps to Host Static Website on Google Cloud Storage.
Creating a CNAME record in DNS :
Go to your respective Domain Service provider account and find DNS
settings and Create a CNAME record that points to
c.storage.googleapis.com.
NAME TYPE DATA
www.example.com CNAME c.storage.googleapis.com
After adding “CNAME” record it will take some time to propagate this
records.
Creating a Cloud Storage Bucket :
Go to Google cloud Console and select Storage from side menu, And
click on Create bucket.
Now create a bucket whose name must matches the CNAME record that
you have created for your domain in DNS settings.
For example, If you added a CNAME record pointing www.example.com
to c.storage.googleapis.com, then create a bucket with the name
www.example.com.
Uploading files to Cloud Storage Bucket :
Now In the list of buckets, click on the name of the bucket that you
have created.
Now create index.html file in your local system for your website
home page.
Now click on Upload files button and select index.html file that
you have created.
Browse the static website :
Now browse your website with your domain name in your web browser.
For example, If your domain name is www.example.com then browse
your website by going to http://www.example.com in your web
browser.
Now, You have successfully hosted your website on Google Cloud
Storage.
Related
I have purchased a domain from aws console (ex:inetglobal.net)
then i have created bucket sky.inetglobal.net and kept a index.html file inside of it. I have enabled website hosting for this bucket.Now trying to map bucket endpoint with in route53 by creating A record
sky.inetglobal.net. A ALIAS s3-website-us-east-1.amazonaws.com
So now if i will type sky.inetglobal.net in browser then content of html file should be visble. But it is not resolve to subdomain sky.inetglobal.net
can any one help in this??
Try having another A record for sub-domain with the same s3 endpoint and it will work.
I have a Cloud storage bucket with static files in it.
I have set up a load balancer with Cloud CDN enabled on the cloud bucket above.
When I go to the public_IP assigned in the load balancer I get an xml error message access denied as this is just an ip, not a landing page.
When I go to public_ip/index.html, then the website load.
EDIT (removing) :The content of the bucket will only be served by a sub-domain of an external domain name, that's why I can't name my bucket as the domain name.
It is possible to rename a bucket as a subdomain, and the landing page definition works, but the base question remains.
Is there a possibility to set the landing page for the IP address anyhow?
Yes, it's possible to configure a landing page for any Cloud Storage bucket using the gsutil command line tool. For example, the following command configures the landing page for the bucket named elving:
gsutil web set -m index.html gs://elving
Unfortunately, it's not currently possible to configure this using the Google Cloud Console. You must use the API directly or use a tool such as gsutil. You can find more information about gsutil at https://cloud.google.com/storage/docs/gsutil.
The Google Cloud Storage documentation states :
If you want the test.example.com to serve the same content as is served from www.example.com, add a CNAME record that aliases "test" to "www". A separate bucket is not needed in this scenario.
https://cloud.google.com/storage/docs/website-configuration?hl=en
With the alias CNAME in place (on Google Cloud DNS) the following error is being thrown by the Cloud Storage :
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist.</Message>
</Error>
Has this behavior changed and the documentation hasn't been updated ? Or are there any additional steps required to make this work ?
I was able to reproduce the same issue. As confirmed with the engineering team, CNAME > CNAME > bucket is not possible which is the opposite of what the documentation is saying. I was able to file a request for the documentation change which should be modified soon. As a workaround, creating a new bucket with the subdomain will resolve your issue.
CNAME is equivalent to your sub domain. Please use the step by step procedure from Google Cloud Platform Documentation. See below:
https://cloud.google.com/dns/docs/quickstart
I am trying to create subdomain for my cloud storage. Now, in my site all files hosted in GCS and have url like: http://commondatastorage.googleapis.com/#buckletname#/file.jpg
I want create subdomain with name like #buckletname#.site.com. For this, I created the name record in domain zone:
#buckletname# IN CNAME c.storage.googleapis.com.
www.#buckletname# IN CNAME c.storage.googleapis.com.
But I can't access files by url #buckletname#.site.com . What am I doing wrong?
Documentation for me is not clear. If you can provide step by step instructions how to implement it.
The name of the bucket must be the full domain, not simply the name of the subdomain.
For example, if you wanted the domain "myproject.site.com" to be hosted by Google Cloud Storage, the bucket name must be "myproject.site.com", and if you wanted the domain "www.myproject.site.com", you must have a bucket named exactly "www.myproject.site.com."
I cannot figure out why I'm experiencing issues with buckets setup to serve content under custom domain. I have few that work just fine, few others that have been working before and do not now, and few I'm struggling to setup from scratch and cannot make them to work.
Here's what I do:
I setup an app on Google App Engine.
I setup a bucket named gcs.domain.com which prompts me to verify domain first with Google
Webmasters Tools and domain TXT record - after that I'm able to
create a bucket.
I setup CNAME to be able to access bucket under my
custom domain.
I add Service Account Name as an owner of the bucket, so my app can write and read from it.
When I run my app I get PHP Fatal error Invalid Google Cloud Storage path: gs://gcs.domain.com CloudStorageStreamWrapper.php on line 327
I cannot pin point why. This scenario works on some of the domains and apps and does not on others. I can setup a bucket with a regular name that works just fine. The problem seems to be only with custom domain buckets.