在Google Cloud中设置网站? [英] Setting up a website in Google Cloud?

查看:228
本文介绍了在Google Cloud中设置网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全迷失了。我习惯于使用简单的网络主机与cPanel来制作网站,只需登录filezilla并上传我的html / css / php / js文件即可。



为什么我想使用Google Cloud作为我的服务器/主机,是因为我担心我的新网站会获得过多的流量,并且标准的网络托管公司无法应对,或者会太贵。



但看着Google Cloud,这个过程非常复杂,术语几乎听起来像与托管网站无关。



他们讨论'apps','containers','bucket','linux'等。

我想要设置一个动态网站有SSL,SQL,PHP等,我可以用FTP上传 - 像往常一样,但有很高的可扩展性。

或者Google Cloud是完全不相关的东西?



我应该使用Compute Engine还是App Engine?

我不能在这里找到任何体面的外行教程...

解决方案如果您计划使用的服务器端技术是那么你可能想看看Google App Engine。这可能是最简单的选择,让您在不被行话陷入困境的情况下开始工作:下面是一些步骤,让您开始:


  1. 头转至 App Engine PHP '5分钟内的Hello world'页面,快速请阅读
  2. 下载并安装 Google App Engine SDK for PHP

  3. 转到Github并下载 hello world PHP app

  4. 添加您的静态资源,如HTML,CSS& JavaScript到Hello World应用程序。

  5. 删除 helloworld.php 并编辑 app.yaml
  6. code>,并删除处理程序部分,更新应用程序与您的应用程序名称(例如我的静态应用程序)。
  7. 在Google云端控制台上创建一个项目(例如my- static-app)并将您的应用部署为此处解释

现在你已经有一个运行在App Engine上的静态网站,并且可以使用 http://my-static-app.appspot.com

请记住,App Engine是平台即服务(PaaS)。因此,您只需创建应用程序并部署它,而不必担心服务器或其设置等。如果您的应用程序主要由静态资源(如HTML,CSS,JavaScript和图像)组成,那么Google会缓存并提供这些内容单独的内容交付边缘服务器因此,即使流量增长,您也不必担心这些静态资源的可伸缩性。



对于PHP脚本等动态资源,使用App Engine实例并且随着您的需求增长,您可以将您的应用配置为使用更多App Engine实例,如此处解释的



使用App Engine,您无法通过发出简单命令将FTP文件传输到服务器,您需要使用SDK上传代码:

  appcfg.py更新myapp / 


I am completely lost in this. I'm used to using simple web hosts with cpanel to make websites, and just simply login with filezilla and upload my html/css/php/js files.

The reason why I am thinking to use Google Cloud as my server/host is because I am worried that my new website will get too much traffic and a standard web host company won't be able to cope, or will be too expensive.

But looking into Google Cloud, the process is so complicated, and the terminology almost sounds like it has nothing to do with hosting websites??

They talk about 'apps', 'containers', 'buckets', 'linux', etc.

All I want is to set up a dynamic website that has SSL, SQL, PHP etc. where I can upload with FTP - as usual, but have the convenience of high scaleability.

Am I on the right track, or is Google Cloud something completely unrelated?

Should I use Compute Engine, or App Engine??

I can't find any decent lay-man tutorials out there about this...

解决方案

If the server side technology you are planning to use is PHP then you might want to have a look at Google App Engine. It's probably the easiest option to get you started without being bogged down with the jargon: Here are a few steps to get you going:

  1. Head over to the App Engine PHP 'Hello world in 5 mins' page, have a quick read
  2. Download and install the Google App Engine SDK for PHP.
  3. Head over to Github and download the hello world PHP app.
  4. Add your static resources like HTML, CSS & JavaScript to the hello world app.
  5. Remove the helloworld.php and edit the app.yaml and remove the handlers section, the update application with your app name (e.g. my-static-app).
  6. Create a project on the Google Cloud Console (e.g. my-static-app) and deploy your app as explained here.

Now you've got a static Website running on App Engine and accessible using a URL in the format http://my-static-app.appspot.com.

Bear in mind App Engine is a Platform as a Service (PaaS). So you just create your app and deploy it without having to worry about the server or its setup, etc... If your app is primarily made up of static resources like HTML, CSS, JavaScript and images then Google will cache and serve these from separate content delivery edge servers. So you don't have to worry about any scalability for these static resource even if your traffic grows.

For dynamic resources like PHP scripts then these are served using App Engine instances and as your demand grow you can configure your app to use more App Engine instances as explained here.

With App Engine you can't FTP files to the server you need to use the SDK to upload your code by issuing a simple command:

appcfg.py update myapp/

这篇关于在Google Cloud中设置网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆