简体   繁体   English

Google Cloud Platform文件位置

[英]Google Cloud Platform files location

I wanted to move a website from a shared server to Google Cloud but I cannot wrap my head around it. 我想将网站从共享服务器移至Google Cloud,但无法将其包围。 Before giving up completely, I decided to make this question: 在完全放弃之前,我决定提出以下问题:

I already completed the Hello World tutorial ( https://cloud.google.com/php/getting-started/hello-world ). 我已经完成了Hello World教程( https://cloud.google.com/php/getting-started/hello-world )。 But what if I want to update the index.html file? 但是,如果我想更新index.html文件怎么办? Where would I find it? 我在哪里可以找到它?

I was expecting to see it in one of the storage Buckets, but that's not the case... even when installing a Kubernetes Engine. 我原本希望在其中一个存储桶中看到它,但事实并非如此……即使安装Kubernetes引擎也是如此。

If you decide to use Google App Engine Flexible (as the hello world sample app that you linked to) you need to understand the idea of this additional layer of abstraction over your server(s). 如果您决定使用Google App Engine Flexible(作为您链接到的Hello World示例应用程序),则需要了解服务器上这一附加抽象层的概念。 App Engine Flexible is designed to make things easier for you - you focus on your code in your local machine where you modify it, update it and then with one command ( gcloud app deploy ) you instruct the App Engine to do one of the following: App Engine Flexible旨在gcloud app deploy您的工作-您专注于本地计算机上的代码,在其中对其进行修改,更新,然后使用一个命令( gcloud app deploy )指示App Engine执行以下操作之一:

  • start a VM (your server) and a Docker container with your app in it if it's not already running 如果尚未运行VM(您的服务器)和包含您的应用程序的Docker容器,请启动它
  • in case you are updating an existing app, it will update the code in the VM which is your server. 如果您要更新现有的应用程序,它将更新您的服务器VM中的代码。 If your app receives a lot of traffic, you may have more than one container and VM running and all of them will get updated. 如果您的应用收到大量流量,则您可能正在运行多个容器和VM,并且所有容器和VM都会得到更新。

Both things are presented schematically in the image in this section . 这两部分均在本节的图像中进行了简要说明。

This way you can develop your app locally and not worry about actually getting inside the server with for eg ssh . 这样,您可以在本地开发您的应用程序,而不必担心例如使用ssh真正进入服务器。 Your code is there in those VM(s) and App Engine manages it for you (however, if you really need to, it is still possible to ssh into the VM in App Engine Flex environment ). 您的代码在这些VM中,并且App Engine会为您管理代码(但是,如果您确实需要,仍然可以在App Engine Flex环境中ssh进入VM )。

If you have a static website, it can be hosted in the Storage buckets , which is a different scenario. 如果您拥有静态网站,则可以将其托管在Storage buckets中 ,这是另一种情况。 However, as you're using PHP I assume it's more likely that your website is dynamic. 但是,当您使用PHP时,我认为您的网站很有可能是动态的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM