It’s a little-known fact that you can use Google to host a website for free using the company’s service designed for web apps.The trick is to use Google App Engine to take advantage of 1GB of bandwidth per day and 1 GB of free storage space. Getting set up is a little different to setting up with a standard hosting provider, but, inspired by the news this week that the official website for this year’s British Royal wedding is being hosted by Google.
if you have a low traffic website, it is highly likely that you won’t have to spend a penny for web hosting. You get 1 GB of free storage space for hosting your images, HTML web pages and other files and 1 GB of bandwidth per day. If you exceed that quota, you pay-per-use similar to Amazon S3.
Creating a Google Cloud Platform project
To use Google’s tools for your own site or app, you need to create a new project on Google’s Cloud Platform. This requires having a Google account.
1. Go to the Google Cloud Platform Console and select Select a project > Create an empty project.
2. Enter a name for the project, and make a note of your project (application) ID somewhere safe (you can edit it if you like.)
3.If you’ve not created a project before, you’ll need to select whether you want to receive email updates or not, agree to the Terms of Service, then you should be able to press the Create button to create your project.
4. We will need a sample website to publish. If you’ve not got one to use, download and unzip this sample application.
5. Have a look at the sample application’s structure — the static folder contains your website content and app.yaml is your application configuration file.
Your website must go inside the static folder, and its landing page must be called index.html, but apart from that it can take whatever form you like.
Your app.yaml file needs to be edited, but don’t worry — it’s a very simple file. You don’t need to change anything in it except for the application field, the value of which should be changed from your-project-id to your actual real
project ID that you saved earlier (you can also do this via the Google App Engine Launcher, as we’ll see later.)
Installing the necessary tools
1. The tool we’ll be using — Google App Engine SDK — can be used with various different coding environments. We’ll use it with Python for this tutorial.
2.Make sure Python 2.7.x is installed on your computer. Here is a setup guide to installing Python on Windows; Mac OS X and most common flavors of Linux come with Python 2.7 already installed.
Download and install Google App Engine SDK for Python.
Publishing your app
Now we’ve got our project made, sample app files collected together and tools installed, let’s publish our app.
1.Open the GoogleAppEngineLauncher application. It may ask you if you want to make command symlinks. This is a good idea, so click yes.
2.Click File > Add Existing Application > Browse, select your sample app’s root folder, then select Add to add it to the launcher.
Select the sample app and click the Run button then the Browse button to test your app locally.
3.If you’re happy with the result, you are now ready to deploy it. If you’ve not already added your project ID to your app.yaml configuration file, click the Edit button now — this will open up the app.yaml file in your default text editor, at which point you can edit it appropriately (change your-project-id to your actual real project ID) then save and close it.
4.Your real project ID should now be listed in the Name column in the launcher app.
5.Now press the Deploy button to deploy it. A web browser window should open, and you’ll be taken few a few authentication steps in the Google services, such as choosing your Google account. Eventually you’ll get a success message.