How are people using Google App-Engine apps with their own domains? - google-app-engine

I've been fooling around with the Google App Engine for a few days and I have a little hobby application that I want to write and deploy.
However I'd like to set it up so that users are not directly accessing the app via appspot.com.
Is hosting it through Google Apps and then pointing it at my own domain the only way to go? I looked at that a little bit and it seemed like a pain to implement but maybe I'm just missing something.
My other thought was to write the app-engine piece as a more generic web-service.
Then I could have the user-facing piece be hosted anywhere, written in any language, and have it query the appspot.com url.
Anyone have any luck with the web-service approach?

The reason Google Apps is required is because you need somewhere to a) verify you own the domain (otherwise, you might point it at app engine, then I might hijack it by adding it to my account) and b) set up domain mappings (which subdomains point to which of your appengine apps).
Since this stuff already exists in Apps, it seems silly to duplicate it in AppEngine.
As has been pointed out, it doesn't cost anything, and you do not need to "move" anything to Google. You simple created a cname record with a random name to verify you own the domain, and a cname for the subdomain you wish to point at App Engine. This only takes a few minutes, and once it's done, it's done forever.
Note: If you host your site elsewhere and use webservices, you need to scale the site/frontend. If you host on app engine, you get this for free :-)
I wrote an article on my blog about redirecting *.appspot.com domains to your custom domain to keep your branding:
http://blog.dantup.com/2009/12/redirecting-requests-from-appid-appspot-com-to-a-custom-domain

To do this, I believe you need to be using Google Apps and have a custom domain setup for Google Apps. Then, you deploy your app into your Google Apps domain.

Here is google's official instructions on how to do that:
http://code.google.com/appengine/docs/domain.html
I have used this process for a couple of sites and it is easy and painless, provided you have control on the DNS records for your domain (you should).

OK, we're now at the end of 2017 and things are a lot different regarding App Engine and custom domains. It's easy now!
Go to the app engine dashboard for your app and choose Settings, then go to the Custom Domains tab. From there, choose Add custom domain.
The tricky part is that Google needs to verify that you control the domain, so they ask you to put a TXT record in the DNS for your domain. Once you do that and Google it, you become "verified" as the owner of the domain.
After that, Google will give you a bunch of A and AAAA (for IP6) records to put in your DNS. Once you've done that, you should be good to go.

It can be easily done using request.getRequestURI() method. If the URL doesn't include your domain, just redirect it to the desired URL using
resp.sendRedirect("<your domain>")
Otherwise load a error page using
request.getRequestDispatcher("<error-page>").forward(request, response);

Related

can i make a subdomain to point a different app in GAE?

i am a newbie to Google app engine web application.there are two seperate gae web applications in which one application intended for staging and the other application used for live production purpose.we bought a domain for eg: example.com which we point to staging as
www.staging-example.com(it is working fine). what i want to do is that with the same domain name can i make it to point to the live production app like for eg: www.live-example.com. is it possible?.if its possible please tell me how?. your answers will be very appreciable.
thanks in advance
Please be aware that www.staging-example.com and www.live-example.com are two completely different and independent domains apart from the fact that they are both .com domains.
Since app engine does not support naked domain redirection with SSL (staging-example.com, live-example.com would not work with SSL) you have to use subdomains anyway, like staging.example.com and live.example.com.
And yes that is possible and basically the exact same steps for each app. Since you set that up for your staging domain this should be a piece of cake for you. The steps are described in here, but the highlights are:
Create a CNAME record for your subdomain which points to ghs.googlehosted.com
Add the custom domain in your apps project custom domain settings.

App Engine SSL for Custom Domain within Developer Console (not via Google Apps)

When will SSL support for custom domain be available within the developer console, instead of having to go over to Google Apps? I read somewhere it says Q3 of 2015. But seems like people have some ways of getting that to work already. Is it a private beta feature?
Building some apps for a client and they can't get their Google Apps account to work and we already have the custom sub-domain mapped to the GAE, and just need the last piece. Help!
This is the tracking issue, indeed Q3 seems to be more likely: https://code.google.com/p/googleappengine/issues/detail?id=10794
FWIW, I detailed a bit my solution to get things working via Google Apps in this Q&A: AppEngine subdomains to modules without wildcard mapping, maybe it can help with your customer's problems in the meantime.

Setting up custom domains (with subdomains) on Google App Engine with SSL with different versions of app

Problem I want to solve
I want to be able to send different users to different versions of my Google App Engine application, on a custom domain, with SSL enabled. This needs to be done in a controlled way, i.e., even landing page should be different, and it has to work on multiple units for the user.
Solution I can't get to work
I am trying to setup a custom domain with sub-domains, and want to be able to access different versions of the application. For example, I have myapp.mydomain.com, and I want to run one version (alpha) on alpha.myapp.mydomain.com, and one version (beta) on beta.myapp.mydomain.com (where alpha is default).
I use the Google Developers Console to set up custom domains, using myapp.mydomain.com, and *.myapp.mydomain.com as custom domains.
This works perfectly as long as I don't try to add on SSL as well, i.e., beta.myapp.mydomain.com serves the version named beta. When I set up SSL I start by adding my application to Google Apps, (per https://developers.google.com/appengine/docs/ssl) and then set up my domain to point to my app. First I add myapp.mydomain.com, then alpha.myapp.mydomain.com, and last beta.myapp.mydomain.com.
When that is done beta.myapp.mydomain.com start to serve the default version instead. Except that it sometimes also serves the beta version (this happens one in every 20 tries or so, I assume it's a glitch for now).
My questions:
a) Should I set up my domains in both Google Apps and Google Developer Console? Or should I remove the setup from Google Developer Console? I tried both, seems to give the same results.
b) It seems like it is possible to get it done by using modules as indicated in
Google App Engine custom domains, subdomains and SSL and in Appengine modules dispatch.xml routing with custom domain. Is this the only way, or am I doing something wrong in my setup?
Suggestions I have received so far
One suggestion is to use traffic splitting and set a unique cookie depending on what version I want the user to end up with. I did not know about this, and it will solve some other issues I have been looking at. It does not solve my current problem though, as I need to have this set before log in. The answer is useful though.
I'll answer with what I did to make this work for me.
Instead of sending users to different versions of the app, I created a new module called alpha, and directed users using alpha.myapp.mydomain.com to that module using dispatch.xml.
<dispatch>
<url>*alpha.myapp.mydomain.com/*</url>
<module>alpha</module>
</dispatch>
I set up custom domains in the App Engine Console (https://console.developers.google.com) under Compute->App Engine->Custom Domains, for *.myapp.mydomain.com and alpha.myapp.mydomain.com. I also added the URL alpha.myapp.mydomain.com to the accepted URLs for my App Engine app on Google Apps (https://admin.google.com). This allowed me to run over SSL as well.
I intend to run the app under another domain (domain alias to my primary domain), so I tried that as well. To make this work I ONLY added the domain alias in Google Apps as www.mydomainalias.com and alpha.mydomainalias.com, because if I added it to Google App Engine custom domains I got an error message ("We are unable to process your request at this time. Please try again later. (Error #1000)"). I have no idea why it that did not work out.
The easier approach is to do traffic splitting on a cookie level compared to setting up extra subdomains AND extra SSL certificates.
The domain name to access your alpha version does not have to change using this approach.
from the docs :
The response from your app does not already contain a Set-Cookie:
GOOGAPPUID=... header. This allows your app to control which version a
user gets.

google appspot application on custom domain? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Google Appengine & google Apps - mapping www.mydomain.com to my-app-id.appspot.com
I already own a custom domain for example www.onlinecourse.com, and I already have an application running on google infrastructure or google app engine with www.onlinecourse.appspot.com (just for example).
What I want is when user try to access www.onlinecourse.com, my application that is running at www.onlinecourse.appspot.com should open up without URL redirection.
I was completely fooled by this statement from google app engine.
"You can serve your app from your own domain name (such as http://www.example.com/) using Google Apps. Or, you can serve your app using a free name on the appspot.com domain. You can share your application with the world, or limit access to members of your organization."
I thought www.onlinecourse.com would completely replaces the www.onlinecourse.appspot.com
To just add a custom domain, just follow the instructions here:
http://code.google.com/appengine/articles/domains.html
And once that works, you can put a check in your code to forward anyone landing on the appspot.com domain to your domain: (example in python)
def get(self):
if self.request.host.endswith('appspot.com'):
return self.redirect('www.jaavuu.com', True)
# ... your code ...
The answer to this question should be just this url
http://code.google.com/appengine/articles/domains.html
which Amir has already pointed out.
But let me add some stuff. Firstly this is not a programming question. Second, nonetheless here's my answer.
Google uses Google Apps to manage its domains. Google Apps is something companies sign up for when they want to use gmail on mail#companydomain.com. Using Google Apps just for domain name mapping is a bit redundant, especially if you don't want any of the other stuff. But since you can disable the email, chat and other stuff, and since it is free, there is no reason , why you shouldn't sign up for Google Apps. First goto. http://www.google.com/a and sign up for the standard edition of google apps. Use a cname/meta tag/html file to verify your domain name. Once you have done that, you can add the domain name you want to use for your appspot hosted GAE app(eg. if you own the domain mydomain.com, you should map www.mydomain.com). You can redirect mydomain.com to www.domain.com using one of the n number of 301 redirect methods. I hear Google provides some IPs you can point your A names to.
Tutorial link:
http://aralbalkan.com/1466
In the tutorial, Mr. Balkan uses dynds as an example, which might not do the thing for you(it's not free). As I said before, your registrar might have enough DNS options. Else you can go for something like http://geoscaling.com (free 10 domains). The rest of the stuff should be the same.
(I guess you already have something to manage your DNS, for eg, Your domain name registrar generally gives you some amount of DNS control. Go into your domain's DNS settings and change the CNAME when required. If you can ftp to your domain's hosting, you will be able to use the meta tag or html file option to verify your domain. There are plenty of tutorials for Google Apps out there. If you are unsure, post a comment and I will expand the post)
After you are through, your www.onlinecourses.com should be what the user sees.

Redirecting domain (not google apps) to appengine

I'm building a application that supports different domains. A small CMS that supports different domains.
But what I can't figure out is how to redirect other domains that's outside google apps. I have a domain at google apps, that work's perfectly.
When I create a cname that points at either my appid.appspot.com or www.appsdomain.com it just goes to google.com.
What do I need to do so the other domains point to my appengine application.
..fredrik
You can't just use a cname because google needs to know how to direct the requests through their infrastructure to your app.
You should follow the instructions here: http://code.google.com/appengine/docs/domain.html to set up your name with their infrastructure so that requests to the cname get routed correctly.
Update: You do not have to move your domain to google, only inform them of the names you are going to set up cnames to point to them.
You can do that without a cname.
You need to set up a redirection mechanism of your second domain name. You can do that either by telling your registrar to redirect that url to your Google Apps url (that's how I do it with my registrar, name.com), or you could set up a small [php] script on a server you manage that would receive the queries on the second domain and issue a 301 redirect to your Google Apps domain.
EDIT: It all depends on what you want to do. If you want your app to live at both urls, then this solution will not work. I wrote this in the idea that you want the second url to redirect to your main url, if that's not what you want to do, then issuing redirects won't do the trick.

Resources