How to use Google App Engine with my own naked domain (not subdomain)? - google-app-engine

After hours of reading about and experimenting with DNS records I can access my Google App Engine app via these URLs:
myappid.appspot.com
www.myappid.myowndomain.example
What does not work:
myowndomain.example
www.myowndomain.example
I want to be able to serve my app directly off my domain and not a subdomain. I've seen apps that do this. Is there any way to do this without a URL redirect?

[Update April 2016] This answer is now outdated, custom naked domain mapping is supported, see Lawrence Mok's answer.
I have figured it out!
First off: it is impossible to link something like mydomain.example with your appspot app. This is considered a naked domain, which is not supported by Google App Engine (anymore). Strictly speaking, the answer to my question has to be "impossible". Read on...
All you can do is add subdomains pointing to your app, e.g myappid.mydomain.example. The key to get your top level domain linked to your app is to realize that www is a subdomain like any other!
myappid.mydomain.example is treated exactly the same as www.mydomain.example!
Here are the steps:
Go to appengine.google.com, open your app
Administration > Versions > Add Domain... (your domain has to be linked to your Google Apps account, follow the steps to do that including the domain verification.)
Go to www.google.com/a/yourdomain.example
Dashboard > your app should be listed here. Click on it.
myappid settings page > Web address > Add new URL
Simply enter www and click Add
Using your domain hosting provider's web interface, add a CNAME for www for your domain and point to ghs.googlehosted.com
Now you have www.mydomain.example linked to your app.
I wished this would have been more obvious in the documentation.

[update 2015-09-28] Now Google lets you add custom domains (including naked domains) and setup SSL without the need of Google Apps. For details refer to here: https://cloud.google.com/appengine/docs/using-custom-domains-and-ssl?hl=en
I just discovered today (as of 2014-04-11) a new custom domain settings page is available from Google Developers Console:
1. Go to https://console.developers.google.com/project
2. Click on your project
3. On the left click "App Engine"
4. Click "Settings"
There you go! You can configure custom domain without the need of Google App account!

[Update April 2016] This answer is now outdated, custom naked domain mapping is supported, see Lawrence Mok's answer.
See http://www.google.com/support/a/bin/answer.py?hl=en&answer=91077 for the details. Once you have signed up for Google Apps for Your Domain:
# Sign in to the Google App Engine admin console.
# Go to Administration > Versions
# Click the 'Add Domain...' button under Domain Setup.
# Enter your domain name in the 'Domain Name:' field
# Click 'Add Domain'. You will be directed to the Google Apps administrator console to complete the process.
# Log in to the Google Apps control panel with your administrator account.
# Accept the terms and specify the access URL you'd like to provide for your application.
# Click 'Accept
You can't use a naked domain, though, such as whatever.example (but www.whatever.example does work), because:
Due to recent changes, Google App Engine no longer supports mapping
your app to a naked domain. If your domain registrar supports URL
redirects, you can redirect from http://yourdomain.example to your app,
which can be served from domains like http://www.yourdomain.example or
http://appid.yourdomain.example.
as specified at http://www.google.com/support/a/bin/answer.py?answer=91080

If like me you have seen this message while trying to add 'www' as a subdomain inorder to get your own domain working:
'Already used, please remove previous
mapping first . '
The above process mentioned in other answers has changed slightly if you are using Google Apps for your domain.
You must now do this as well:
Google Apps -> Service Settings -> Sites. Click 'Web address mapping' and remove the 'www' mapping which has been added by default to Sites.
Then you can add the 'www' subdomain for your App engine app
see this link:
http://groups.google.com/group/google-appengine/web/deleting-existing-www-mapping-from-google-apps

Another solution which is given by Google is URL forwarding: http://www.google.com/support/a/bin/answer.py?hl=en-in&answer=61057

Google does offer naked domain redirection.
Login to your google apps account and select "manage this domain"
Navigate to Domain settings
Within Domain Setings, navigate to Domain names
There's a link that says "change the A record". Clicking that will give you the destination IPs for the A records you need to create.

Google does not provide an IP for us to set A record. If it would we could use naked domains.
There is another option, by setting A record to foreign web server's IP and that server could make an HTTP redirect from e.g domain.example to www.domain.example (check out GiDNS)

For App Engine in 2019, googles has made it easier to set up a custom domain.
Google App Engine -> Settings -> Custom Domains
Verify your domain
Select Your Domain Name Registra
Reminder: Use TXT Record with the value Google provides without a existing CNAME record, otherwise TXT Record will be override
Follow the steps on the page, which includes the configuration of your subdomain, CNAME Record, A Record, AAAA Record, and you'll be good to go.

Just managed to sort this finally after hours. The www subdomain was pointing to Sites, but the front end wasn't showing me that.
After taking the plunge and setting the CNAME to gwh.google.com, and enabling / disabling Sites a couple of times (see the comment from Rodrigo Moraes on http://groups.google.com/group/google-appengine/web/deleting-existing-www-mapping-from-google-apps) I was able to set the Sites address to use the www subdomain.
I was then able to change it away from using the www subdomain, at which point the appengine app allowed me to specify the www subdomain.
That is one dirty fix - basically turning on and off Sites until it works!

When you go to "Application Settings -> Add Domain" It will ask to select login account, probably you are already on gmail account so it will show gmail account as well, but you should use Google Apps account where you have mapped your custom domain.

You can redirect forward or mask your domain name in godaddy but I don't know about other hosting sites.Have a look on this link

Here is a tutorial from Google about mapping your App on custom domain: https://cloud.google.com/appengine/docs/domain?hl=FR
It should be the latest update. But please note these 2 things:
1- You may not find you App in the new developer console, then the only workaround for that is download your source code, create a new app from the new developer console and deploy it.
2- You find your App on the developer console, but under the Compute menu you may not find the App Engine Settings as mentioned in the tutorial, then you have to proceed the same as i explained in the first point (create another application)
I hope this helps !

You can create a custom domain (including naked domain) for your App Engine and you can also set up self managed SSL certificates there.
To use a custom domain, map the domain to your app, then update your DNS records. You can map a naked domain, such as example.com or a subdomain, such as subdomain.example.com. You can also use wildcards to map subdomains.
The steps to map custom domain to your application are following -
In Console,go to the Application settings tab of the App Engine Settings page
-->If you need to enable G Suite authentication then click Edit to modify the Google Accounts API Referrer-->In the Google Authentication drop-down menu, select G Suite domain, then add your domain such as example.com in the empty field.
Go to the Custom Domains tab of the App Engine Settings page--> Click on add custom Domain-->If your Domain is already verified then select it from the drop down menu-->click Continue.
If you haven't verified your domain yet, follow the steps below:
a) Select Verify a new domain from the drop-down menu.
b) Enter your naked domain name (such as "example.com") and click Verify.
c) Enter information in the Webmaster Central window that appears.
d) After you complete the steps in Webmaster Central, return to the Add a new
custom domain page in the Google Cloud Console.
In the Point your domain to (project-ID) section, specify the domain and subdomains that you want to map.We recommend mapping the naked domain and the www subdomain-->click Save mapping.
Sign in to your domain registrar web site and update your DNS records.
Please refer to the following link for detailed description of required steps -
https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains

You must try like this, Application Settings > Add Domain...

Related

How to configure custom domain for App Engine for service that is not the defautl in GCP?

I have one Node aplication runing on default App Engine service. Its was runing on "urlFromWebSite.appspot.com", and I config it to run in my domain url "customUrl.ai".
I built a second service with Node with name "second-service",and its runing at
"service-two-doturlFromWebSite.appspot.com", but i want to run at "subDomain.customUrl.ai"
I tried dispatch.yaml file with the url that i want for 'second-service';
Stack post 1 talking about dipatch
Stack post 1 talking about dipatch
GCP explanation for dispatch
I have tried Custom domains in App Engine > Settings > Custom domains;
GCP documentation for mapping custom domains
At custom domains I config my subdomain url, and it generates the DNS. ยด
I have question here:
Where should I add this DNS config? At the "customUrl" or should i create a new record set for it?
I have been strugling with it for 2 days already, and could figure it out how to solve it. How should i config this to change my second service's url for a custom subdomain?
When user enters customUrl.ai in a browser, traffic should be routed to Google's servers (for your GAE project). To do that, you configure DNS settings on your domain registrar's end.
When user enters subDomain.customUrl.ai in a browser, traffic should be routed to Google's servers. To do that, you also configure DNS settings on your domain registrar's end.
Both #1 & #2 are done for the same domain on your domain registrar's end (which is GoDaddy in your case). I believe this is what #JohnHanley is referring to. Put another way - just go to GoDaddy, find your domain and create entries corresponding to what GAE has outlined for you. If they are duplicates, GoDaddy will tell you.

How do I add my own custom domain to a Google App Engine site in 2016? [duplicate]

This question already has answers here:
How to use Google App Engine with my own naked domain (not subdomain)?
(14 answers)
Closed 6 years ago.
I have a google app engine hosted website and I want my app to have it's own custom domain. How do I go about doing that?
(I realize this question has been asked before, but I am including it again to give a more in-depth answer to the answers already given about this topic.)
Perform the following steps:
Go to the Google Cloud Platform Console
Go to App Engine -> Settings -> Custom Domains
Select Add custom domain
Verify your domain ownership according to Step 1
Select the domain you wish to use for this app in Step 2
Login to your domain management and configure the domain as described in Step 3
If you do not own a domain since before you must buy one, there is an option to do that from Google if you click "Register a new domain" instead of "Add custom domain" in step 3. But any domain registrar would work really.
To add your own custom domain, you first have to purchase a domain (there are several domain providers out there, and Google provides domains for purchase as well)
After purchasing a domain, go to your console of Google App Engine. The way I usually get there is by doing the following:
Go to console.cloud.google.com (you will be prompted to sign-in to your google account at this step if you have not already)
Click the top-left drop-down menu (products & services)
In the drop-down menu, scroll to "Compute" and select "App Engine" (this will take you to the app engine dashboard)
Go to settings (last link in the app engine menu)
Once in the settings page, select "Custom domains" (located next to application settings and SSL certificates)
Select "Add a custom domain"
Once on this page, in step 1, type in your domain that you purchased (example.com) and click "verify". This will lead you through a process that will verify that you own this domain. Google provides pretty good detailed instructions on how to do this. Note: if you own a domain that was purchased through Google that is on the same account as your google app engine account, you (usually) do not have to do this step since google will already have verified that you own this domain.
After step 1 of this process, step 2 is fairly simple. Select the type of domain you would like to add (the second option "CNAME" will already be pre-selected for you).
If using the second "CNAME" option, type in the subdomain you would like to use for your website (generally, this is going to be 'www') and select "Add". After this, configure your domain DNS by going to the console of your domain provider and adding a new CNAME type DNS address with 'www' as the host (or whatever you decided to use as your subdomain) and ghs.googlehosted.com as the DNS address (or whatever google app engine tells you to put in step 3 of the custom domains page).
If you want to add a naked domain (first option) ('A' and 'AAAA' type DNS address) as well, that's easy! Select the first bullet point option and click "Add". In step 3, you will be given the resource records that you need to add in your domain hosts DNS configuration page. Make sure you type in the IPv4 and IPv6 addresses exactly!
Your new, shiny custom domain should (hopefully) be up and running within 1 hour (48 hours max)!
Note: Verify that your naked domain and/or CNAME domain addresses were properly added to google app engine by refreshing the "custom domains" page. If you do not see the records listed, then you either forgot to click "Add" in step 2 of adding a custom domain, or there was an error. Try signing out and signing back in if this occurs.

How do I enable SSL for custom domains on appengine?

How do I activate SSL for custom domains on Google Appengine?
The instructions I have read, at https://developers.google.com/appengine/docs/ssl or https://support.google.com/a/answer/2644334?hl=en , seem to refer to an old version of the admin console for Google Apps.
I looked at https://support.google.com/a/answer/2644334?hl=en , but on the current console, if I do Security > Advanced Settings > Set up SSO, there is no place where it asks for the AppEngine Application ID.
I looked at https://developers.google.com/appengine/docs/ssl . It directs me to go to the Admin Console of my App domain, and to find a Domain Settings tab and then go to the SSL subtab. There is no Domain Settings tab, however, and the "Domains" tab only allows me to add domains (without http / https mention).
So, how do I setup SSL for my appengine app that uses a custom domain?
Note: this question has been asked already on StackOverflow, some years ago, but the google dashboards have changed since then, and the information I could find is no longer relevant.
Ok, so that other people can avoid wasting as much time as I did.
When you go to the admin console for your domain, you need to click on Security, but NOT on Advanced settings. Rather, pay attention to the small "Show more" below the other options. If you click that, "SSL for Custom Domains" will magically appear.
No thanks to Google for this horrible user interface.
Hallelujah to Luca. I've wasted a day on this. I had already added the custom domain in the GAE app engine console and was getting the cryptic "We are unable to process your request at this time. Please try again later. (Error #1000)" message.
I wasn't able to assign the certificate to my custom domain. The custom domain wouldn't show in the list in the GAE Security Settings (custom domain) until after removing the custom domain from the GAE console.
AppEngine Introducing managed SSL for Google App Engine for customs domains and it will be got activated automatically, for already added domains please remove it and add once again
More Information-
https://cloudplatform.googleblog.com/2017/09/introducing-managed-SSL-for-Google-App-Engine.html
https://cloud.google.com/appengine/docs/standard/python/securing-custom-domains-with-ssl

Need add secondary domain to GAE application

I have an AppEngine app running at myappname.appspot.com, and I've added the URL status.domain1.com. However, the point of this whole project is have the app running at: status.domain2.com. We have domain1.com as the main domain associated with our Google Apps account, and domain2.com is linked that account as a active domain.
When I go to 'myappname (App Engine) settings' in our control panel, and I try to "Add new URL" as status.domain2.com, I get the error banner:
The term 'domain2.com' is not allowed.
This is even though 'domain2.com' is listed as one of the domains associated with our account, and available on the drop-down menu.
How can I get the VirtualHost status.domain2.com to work? We already have this domain on our Google Apps account, but Google Apps support can't help.
This question is similar to Google App Engine and domain name and
How do I point multiple domain names at a single Google App Engine application?, but in this case I'm able to add 'myname#domain2.com' as an administrator of the 'domain2.com' domain on Google Apps, and I have 'domain2.com' as a drop-down option when I do "Add new URL" but I still get an error.
This bug in GAE has me pulling my hair out. Wish I'd not gone this route.
In order to use status.domain2.com with app engine, you have to add it to your google apps account as a domain alias and not as an active domain.
Google does not make this easy to find out, but see the last paragraph of this page: http://support.google.com/a/bin/answer.py?hl=en&answer=182081

domain aliases and Google App Engine

I have a Google Apps domain at www.openstv.org that I use for email and a website.
I recently created a Google App Engine app at stv.appspot.com and it can also be accessed at opal.openstv.org.
I would like to:
Use www.opavote.org for my Google App Engine app instead of opal.openstv.org, and
Have opavote.org be a domain alias of openstv.org so that I don't have to maintain two Google Apps domains.
Two stackoverflow questions suggest that this is possible:
Google App Engine on Google Apps Domain
Google App Engine and domain name
But other reputable information suggests that it is not possible: Issue 638
I've tried to do this, but I can't get it to work. Is there an explanation for this apparent contradiction?
EDIT: Adding what I tried in response to Nick's comment.
From App Engine Dashboard:
Go to Application Settings
Click Domain Setup
Enter opavote.org -> "Sorry, you've reached a login page for a domain that isn't using Google Apps. Please check the web address and try again."
Click back and enter openstv.org -> Takes me to Google Apps for Openstv.org
From Google Apps Dashboard for OpenSTV.org -> stv settings (my GAE app) -> Click add new URL
I'm allowed to enter a subdomain of openstv.org (e.g., opal.openstv.org) but I am not allowed to use the opavote.org domain (there is no dropdown menu for the domain).
Go to Google Apps -> Domain Settings -> Domain Names and see that opavote.org is listed as a domain alias and is verified in two ways (DNS record and uploading file). No other options here.
If you've added 'opavote.org' as an alias, it should be showing up in the list - this sounds like a bug with Apps. Have you tried removing it and re-adding it? If that doesn't work, you may need to file an issue with the Apps team. It's definitely possible to do this - I'm running apps off alias domains myself.

Resources