Can I use Google Cloud Platform to host my website? - google-app-engine

I have a simple static website and I was wondering if I can host my website in google cloud?
I am not sure how much this can cost and how I can figure this out.
I already hosting my website somewhere but I am not happy with their email services. And I was thinking if I can host with Google Cloud and I can use google email as well.
Thank you!

If your requirement is to host static website (with not much traffic), I would suggest Google App Engine Standard than Google Cloud engine. With google app engine standard, if your site doesn't have any hits, it would be automatically taken down. Once there is a hit, it would be brought back automatically. You would save lot of money. Check the prices at https://cloud.google.com/pricing/
Regarding email, if you want google to host your business emails, its not free, you might want to start at https://gsuite.google.com/products/gmail/

Yes, Google App Engine can host your static website. Here's how I have my site setup.
main.go
package main
import (
"net/http"
)
func init() {
fs := http.FileServer(http.Dir("web"))
http.Handle("/", fs)
}
app.yaml
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
You'll need the Google Cloud SDK and app-engine-go component to test locally and deploy your website.
https://cloud.google.com/appengine/docs/standard/go/download
Once that's installed you can open a terminal and navigate to the folder with app.yaml in it then run gcloud app deploy
After the deploy is finished a new version will show up in your app engine account. You can test the deployed version by clicking on the version name in the table.
https://console.cloud.google.com/appengine/versions
Then you'll need to follow the instruction to point your domain to google's hosting
https://console.cloud.google.com/appengine/settings/domains
If you use more than the free quota then they'll charge you.
For example, 1GB of bandwidth per day is free then the $.12/GB after that
https://cloud.google.com/appengine/quotas#Requests
You can set your daily spending limit to $0 to prevent charges, but this will cause your website to go down once your free quote is reached.
https://console.cloud.google.com/appengine/settings
You can keep an eye on the cost from the app engine dashboard
https://console.cloud.google.com/appengine

You can but it's depend upon your requirement, like open source plateform can be host in share hosting whereas nodejs etc must be host ion dedicated server example vps.

Yes:
The most cost effective way of hosting a static (HTML) website on Google Cloud Platform is to store it in a cloud storage bucket. Since Cloud Storage comes with an always free tier, this can save a lot of money over time. See this article for details on hosting it on Cloud Storage https://cloud.google.com/storage/docs/hosting-static-website
Google's Firebase hosting would be another viable option.
Email:
IAAS/SAAS Email is not automatically built into hosting on GCP, but if you transfer your domain to Google Domains then you can seamlessly sign up for Googles G-Suite [Gmail based] email for your domain.

Related

How can I use Google Cloud CDN for static website hosted on Google App Engine?

I am serving a super simple static website on Google App Engine. I chose the Zurich location which serves content pretty decently within all locations that I tested within Europe. Speed tests that I did online show <1s page load speeds within Europe. In the US, especially west coast, South America, Asia and Australia the page load time is, however, over 3s which is for me not acceptable.
Therefore I thought of using Google Cloud CDN. Unfortunately their CDN seems to require some HTTPS load balancers and I have no idea how to set that up. Seems silly if Google had their own CDN but that doesn't work with their App Engine so I'd have to go to Cloudflare.
Unfortunately, you're not able to use Google Cloud CDN for you site on Google App Engine. Nowadays Cloud CDN could be used to serve content that originates from Cloud Storage buckets, Compute Engine instance groups, and Compute Engine network endpoint groups.
Have a look at the documentation Overview of Cloud CDN:
The Cloud CDN content delivery network works with HTTP(S) load
balancing to deliver content to your users. The HTTP(S) load balancer
provides the frontend IP addresses and ports that receive requests and
the backends that respond to the requests.
Cloud CDN content can be sourced from various types of backends:
Instance groups
Zonal network endpoint groups (NEGs)
Internet network endpoint groups (NEGs) (Beta), for endpoints that are outside of Google Cloud (also known as custom origins)
Buckets in Google Cloud Storage
I found at Google Public Issue Tracker two feature requests about adding Cloud CDN support for App Engine Standard and Flexible - you can join these cases, comment and track progress.
Possible workaround for a simple site you can find in this article.

There is limit on google cloud projects and firebase projects?

I build websites, maybe 100 per year maybe more and I start to use Firebase and Google cloud for my hosting and as a backend but after some projects on blade for firebase I am not able to create new projects.
I make project quota to increase my projects but I don't have any response
My point is there is any alternative for hosting angular 2 apps with node.js
backend
There are lot more of hosting options available on google cloud than only firebase.
Google App Engine(Standard) is one of them. They even give you a predefined run time environment. If you want to use node.js in the background you just have to mention node as your runtime environment in the application configuration file.
Then there is Google App Engine(flexible)
If you want to create your own virtual machine and create your own servers you can choose Google Compute Engine

I want to choose my own Server and own database in google app engine

I am very newly in google app engine.. There are three Questoins on google app engine and in google app engine i want to choose JAVA language.
Does google app engine provide private cloude ?
I want to deploy my application with my own server( E.x.glassfish or JBoss) on google app engine ?
I want to use my own database instead of cloud SQL in google app engine?
Is it possible or not?
With Google Cloud Appengine - no, it's impossible.
With Google Cloud Instances or Google Cloud Containers - all of this is possible.
Appengine is just one piece of Google Cloud, designed for very specific job, with infrastructure managed by Google. You can only write some code (with lot of restrictions too) that runs inside it. You can read some details about code restritions there: https://cloud.google.com/appengine/docs/java/#Java_The_sandbox
What you're looking for is Google Cloud Instances, that are more standard virtual machines, where you can run anything you want. See https://cloud.google.com/compute/
There is still tools for Load Balancing, Health Check, Centralized Logging for Cloud Instances, and other stuff similar to features provided by Appengine.

Adding domain to Google Cloud Storage hosted web-app

I am new to Google Cloud Storage.
I want to try Google Cloud Storage to host my web-app. Is it possible to upload my website to Google Cloud Storage and connect own domain without Google Apps premium subscription?
If yes, please check my steps below, how I tried to make it works, and let me know where I where wrong?
I have created Cloud Console project for my web-app. My Project ID: rippl-io
Then linked the domain of the web-app to existing Google Apps account as a secondary (as I were redirected to Google Apps after trying to add new domain from the cloud console). Domain name I am going to use: rippl.io
In App Engine settings in Google Apps I am clicking "Add new url" and selecting rippl.io domain. But it returns error.
I am guessing I can add only primary domain and that must be a reason of error. So, next, to change rippl.io to primary domain I need to upgrade Google Apps to premium. Are any other ways to add own domain to my website on Google Cloud Storage other than buying premium Google Apps?
To add domain # Google Cloud Storage, first you need to verify it from Google Webmaster Tools, then create a bucket exactly matching your domain name e.g. www.example.com upload your data, files etc, then add CNAMEentry www.example.com IN CNAME c.storage.googleapis.com.
Please remember, Google Cloud Storage will work for plain html webpages it will not execute any server side codes like php
gsutil web set -m index.html -e missing.html gs://www.example.com
If you still have php page, you can use below code, but php code will get displayed in webpage view source, it will not get execute:
gsutil setmeta -h Content-Type:text/html gs://www.example.com/demo.php
To add domain # Google App Engine, you need Google Apps for Business account to verify it.

How credential and google cloud storage work?

I am just starting to develop GAE web application. I am trying to get a list of bucket of google cloud storage. I found some code from web site.
there are 3 ways on the web what I found.
using Google storage API
https://code.google.com/p/google-api-java-client/source/browse/storage-serviceaccount-appengine-sample/src/main/java/com/google/api/client/sample/storage/appengine/serviceaccount/StorageSample.java?repo=samples&r=f0c6982b3cde8629511346641bfe4bb5eb28d73f
using Json liblary
but thsi sample needs to configure domain verification for bucket.
using python
our exisiting application is developped by gae for Java. I do not think thie python way can include in Java application.
then I would like to fix No1 way.
It show credential error. Buckets are authorized to everyone (All Authenticated Users )for now. I think I need to understand how the credential works. I have read the google developer page about 0Auth2. I could find a sample of bigquery. if you have a sample or good web sites about credential and google cloud storage, it will be great helpful.
the errors;
Error: com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential.(Ljava/util/Collection;)V
what i did at API console:
creating client id (web application, service account, installed application each)
creating Simple API Access ( new server key , new browser key)
what I did at local machine;
Set ACL with gsutil
my developing environment
eclipse 3.6 helios ( Japanese language pack)
gae java for eclipse
gae 1.8.0
java 1.6.31
google storage API
google client library
others(tomcat,maven)
windows 7 English with Japanese language pack
Your first attempt (number 1) is the best way to focus on getting this to work. The code sample Marc provided uses the built-in App Engine App Identity module to securely identify the App Engine app to other Google APIs: https://developers.google.com/appengine/docs/java/appidentity/#Asserting_Identity_to_Google_APIs
However, there are 2 gotchas to check:
The App Identity module will not work using the local devserver. When running locally there is no way for the local server to securely identity itself to Google production APIs - so you should either look at using a service account with a downloadable key for local testing, or, easiest option (and what I'd recommend for now), is to deploy into a production App Engine environment to test.
Make sure the App Engine service account email address is added to the access control list for the Google Cloud Storage bucket that you are trying to access. Get this email address by looking under the Admin Console (for your App Engine app) -> Application Settings:
Service Account Name:
xxxxxxx#appspot.gserviceaccount.com
To add this to a Google Cloud Storage access control list, either add it to the project team for the project that owns the Google Cloud Storage bucket, or, if you're not using the default access control settings, add it directly to an ACL:
https://developers.google.com/storage/docs/accesscontrol
Service accounts with downloadable key - use this for local testing if you can't test in a production App Engine environment:
https://developers.google.com/accounts/docs/OAuth2ServiceAccount

Resources