谷歌应用引擎App .yaml文件的PHP应用程序(品红应用程序)


Google App Engine app.yaml file for PHP app (Magenta App)

我正在制作这个app.yaml文件,以便将Magento应用程序放在GAE上。我读过大多数与app.yaml文件相关的回复。这是一个wordpress应用程序。然而,我对这么多不同的版本感到非常困惑。https://github.com/eGlobeBizCom/appengine-php-wordpress-starter-project/blob/9130e8ca06fa52a84821b8faffa49b83792b8ebf/app.yaml

但是,Magento应用程序和Drupal的结构不同于Wordpress应用程序。我尝试了几个版本的app.yaml,不工作。我真的希望找出PHP应用程序的app.yaml文件中正确代码的确切规则是什么,这样新手就可以非常快速地在GAE上测试应用程序,而不必纠结于此。

这取决于,app.yaml必须始终存在并对应于您的默认模块。你可以在google开发者控制台-> appengine ->版本中看到你的模块(应该是模块)。每个模块可以有多个版本。

。要从不同的模块中提供应用程序文件(仅php文件)和静态文件(其他所有文件),请查看以下app.yaml和xml。yaml文件:

app.yaml:

application: viewneo-eu
version: pro # production
runtime: php
api_version: 1
threadsafe: true
instance_class: F4
automatic_scaling:
    min_idle_instances: 1 # one instance idleing forever
    max_idle_instances: 4 # 4 x 50 = 200 max requests
    min_pending_latency: 10ms # wait at least, before launching a new instance
    max_pending_latency: automatic # after this time, create a new instance
    max_concurrent_requests: 50
default_expiration: "0m"
handlers:
- url: /(.+)?/?
secure: always
script: build/mod_rewrite.php
- url: /.*
secure: always
script: build/mod_rewrite.php

xml.yaml:

application: viewneo-eu
module: xml
version: pro
runtime: php
api_version: 1
threadsafe: true
instance_class: F1
automatic_scaling:
  min_idle_instances: 1 # one instance idleing forever
  max_idle_instances: 4 # 4 x 50 = 200 max requests
  min_pending_latency: 10ms # wait at least, before launching a new instance
  max_pending_latency: automatic # after this time, create a new instance
  max_concurrent_requests: 50
default_expiration: "0m"
handlers:
- url: /(.*'.(appcache|manifest))
  mime_type: text/cache-manifest
  static_files: static/html/'1
  upload: static/html/(.*'.(appcache|manifest))
  expiration: "0m"
  application_readable: true
  http_headers:
    Access-Control-Allow-Origin: "*"
- url: /(.*'.atom)
  mime_type: application/atom+xml
  static_files: static/html/'1
  upload: static/html/(.*'.atom)
  expiration: "1h"
  http_headers:
    Access-Control-Allow-Origin: "*"
- url: /(.*'.htc)
  mime_type: text/x-component
  static_files: static/html/'1
  upload: static/html/(.*'.htc)
  http_headers:
    Access-Control-Allow-Origin: "*"
- url: /(.*'.html)
  mime_type: text/html
  static_files: static/html/'1
  upload: static/html/(.*'.html)
  expiration: "7d"
  application_readable: true
  http_headers:
    Access-Control-Allow-Origin: "*"
- url: /(.*'.tpl)
  mime_type: text/html
  static_files: static/html/'1
  upload: static/html/(.*'.tpl)
  expiration: "7d"
  application_readable: true
  http_headers:
    Access-Control-Allow-Origin: "*"
- url: /(.*'.rss)
  mime_type: application/rss+xml
  static_files: static/html/'1
  upload: static/html/(.*'.rss)
  expiration: "1h"
  http_headers:
    Access-Control-Allow-Origin: "*"
- url: /(.*'.txt)
  mime_type: text/plain
  static_files: static/html/'1
  upload: static/html/(.*'.txt)
  http_headers:
    Access-Control-Allow-Origin: "*"
- url: /(.*'.xml)
  mime_type: application/xml
  static_files: static/html/'1
  upload: static/html/(.*'.xml)
  expiration: "1h"
  application_readable: true
  http_headers:
    Access-Control-Allow-Origin: "*"

我将各种内容类型拆分为不同的模块,这需要dispatch.yaml:

dispatch.yaml:

application: viewneo-eu
dispatch:
- url: "fonts.viewneo-eu.appspot.com/*"
  module: fonts
- url: "img.viewneo-eu.appspot.com/*"
  module: img
- url: "css.viewneo-eu.appspot.com/*"
  module: css
- url: "js.viewneo-eu.appspot.com/*"
  module: js
- url: "html.viewneo-eu.appspot.com/*"
  module: html
- url: "cdn.viewneo-eu.appspot.com/*"
  module: cdn
- url: "video.viewneo-eu.appspot.com/*"
  module: cdn
- url: "audio.viewneo-eu.appspot.com/*"
  module: cdn
- url: "dev.viewneo-eu.appspot.com/*"
  module: dev
- url: "beta.viewneo-eu.appspot.com/*"
  module: beta

因为我们在app。yaml中一直使用secure ssl对于通配符sub - sub域名不起作用,你可以通过

访问这些

https://fonts-dot-viewneo-eu.appspot.com,https://img-dot-viewneo-eu.appsport.com,…

等等

希望对你有帮助。

罗恩