<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Google Cloud Platform &#8211; Larry的午茶時光</title>
	<atom:link href="https://blog.yuyansoftware.com.tw/tag/google-cloud-platform/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.yuyansoftware.com.tw</link>
	<description></description>
	<lastBuildDate>Sun, 14 Jun 2026 04:23:05 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.3</generator>

<image>
	<url>https://blog.yuyansoftware.com.tw/wp-content/uploads/2022/10/favicon-45x45.png</url>
	<title>Google Cloud Platform &#8211; Larry的午茶時光</title>
	<link>https://blog.yuyansoftware.com.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Google Cloud Storage Client Library</title>
		<link>https://blog.yuyansoftware.com.tw/2014/07/google-cloud-storage-client-library/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sun, 27 Jul 2014 01:31:00 +0000</pubDate>
				<category><![CDATA[網路科技]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2014/07/27/google-cloud-storage-client-library/</guid>

					<description><![CDATA[https://developers.google.com/storage/docs/json_api/v1/ &#8230; ]]></description>
										<content:encoded><![CDATA[<p><a href="https://developers.google.com/storage/docs/json_api/v1/json-api-javascript-samples" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://developers.google.com/storage/docs/json_api/v1/json-api-javascript-samples</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">The sample almost demonstrates everything for authenticated users (who need to have google accounts.) The actions include read, write, modify access control, etc. One problem is that it doesn&#39;t have progress, and currently I can&#39;t find any way to get that information.</span><br />
<span style="font-size: large;"><br />
The sample utilizes Google API (JavaScript gapi.* functions.)&nbsp;</span><br />
<span style="font-size: large;">The API reference webpage:</span><br />
<span style="font-size: large;"><a href="https://developers.google.com/storage/docs/json_api/v1/?hl=zh-TW" target="_blank" rel="noopener noreferrer">https://developers.google.com/storage/docs/json_api/v1/?hl=zh-TW</a></span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;"><br />
</span><a href="https://developers.google.com/storage/docs/json_api/v1/json-api-python-samples" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://developers.google.com/storage/docs/json_api/v1/json-api-python-samples</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">The sample is like a tool in the local development environment. It also needs user authentications (w/ Google account.) As far as a local development tool is concerned, it&#39;s simpler. But it should have less opportunity to become web applications,</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">The sample utilizes third-party python libraries.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;"><br />
</span><a href="https://developers.google.com/appengine/docs/python/googlecloudstorageclient/getstarted" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://developers.google.com/appengine/docs/python/googlecloudstorageclient/getstarted</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">The sample is python code executed in the server side with &#8220;get&#8221; method. It works well in the server side and doesn&#39;t need any authentication, which is reasonable because it is executed in the server side and the App Engine project natively has the authentication to read/write its Cloud Storage.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">The sample doesn&#39;t have progress either. The use case should be read/write text files to Cloud Storage (the server code hangs in reading/writing Blob files.)</span></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google Cloud SQL</title>
		<link>https://blog.yuyansoftware.com.tw/2014/06/google-cloud-sql/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sun, 29 Jun 2014 13:55:00 +0000</pubDate>
				<category><![CDATA[網路科技]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2014/06/29/google-cloud-sql/</guid>

					<description><![CDATA[https://developers.google.com/appengine/docs/python/clo &#8230; ]]></description>
										<content:encoded><![CDATA[<p><a href="https://developers.google.com/appengine/docs/python/cloud-sql/?hl=zh-tw" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://developers.google.com/appengine/docs/python/cloud-sql/?hl=zh-tw</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">因為 App Engine 本身是不支援 relational database 的, 所以一般使用 MySQL 的 web 框架其實是不能在 App Engine 上直接運行, 需要用到另一服務 CloudSQL.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">一般我們說 user friendly, 做 Cloud 服務很重要一點是: developer friendly. CloudSQL 這點做的不錯, 很簡單的跟 MySQL Client 連線, 輸入 command, 反應也都很快.&nbsp;</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">這個 sample 是 webapp2 框架. 其實用 webapp2 好處很多. 他本來就輕量, 而且因為 App Engine 運行環境本來就裝有 webapp2, 所以對開發者來說, 要上傳/維護的檔案真的極少 (跟 Django 比較的話, 差別非常明顯).</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">另一方面, 由於 Django 是主流框架, 大型的開源專案, 持續有在演進, 先進很多, 功能也比較完整. 如果真的將 Django 在 App Engine 上的 ORM 等弄順, 其實是非常有價值的.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">最後補充一下如何在 local 建 MySQLdb 環境, 基本上下面 link 敘述的非常詳細:</span><br />
<span style="font-size: large;"><a href="http://stackoverflow.com/questions/1448429/how-to-install-mysqldb-python-data-access-library-to-mysql-on-mac-os-x" target="_blank" rel="noopener noreferrer">http://stackoverflow.com/questions/1448429/how-to-install-mysqldb-python-data-access-library-to-mysql-on-mac-os-x</a></span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">MySQL &#8211; Python 的專案頁面:</span><br />
<span style="font-size: large;"><a href="http://sourceforge.net/projects/mysql-python/" target="_blank" rel="noopener noreferrer">http://sourceforge.net/projects/mysql-python/</a></span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">Build 的時候會 fail, ex: _mysql.c 找不到 Python.h&nbsp;</span><br />
<span style="font-size: large;">改為 #include &#8220;Python/Python.h&#8221; 就好了</span></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google App Engine (5) : Python, Django</title>
		<link>https://blog.yuyansoftware.com.tw/2014/01/google-app-engine-5-python-django/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sun, 12 Jan 2014 09:44:00 +0000</pubDate>
				<category><![CDATA[網路科技]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2014/01/12/google-app-engine-5-python-django/</guid>

					<description><![CDATA[將 Django 放在 project folder 中開發時幾點要注意的地方: 1. PYTHONPATH  &#8230; ]]></description>
										<content:encoded><![CDATA[<p><span style="font-size: large;">將 Django 放在 project folder 中開發時幾點要注意的地方:</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">1. PYTHONPATH 要指向放 Django 的 folder (PYTHONPATH 會被加到 Python 的 sys.path 裡).</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">2. 在該目錄下&nbsp;&#8220;django-admin.py startproject mysite&#8221; 產生 project. 此時 mysite/mysite 中有 settings.py, urls.py, wsgi.py.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">3. 將 Django 改放到 project folder 中 (mysite).</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">4. 在 project folder 下 &#8220;python manage.py runserver&#8221; 做驗證.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">5. 在 project folder 下 &#8220;python manage.py syncdb&#8221; create database tables. By&nbsp;<a href="https://docs.djangoproject.com/en/1.6/intro/tutorial01/">https://docs.djangoproject.com/en/1.6/intro/tutorial01/</a></span><br />
<span style="font-size: large;">&#8220;The syncdb command looks at the INSTALLED_APPS setting and creates any necessary database tables according to the database settings in your mysite/settings.py file.&#8221;</span></p>
<div><span style="font-size: large;"><br />
</span></div>
<div><span style="font-size: large;">6.&nbsp;在 project folder 下&nbsp;&#8220;python manage.py startapp polls&#8221; 產生第一個 app (注意之前 mysite/mysite 不是 app). 此時 polls folder 中有 admin.py, models.py, tests.py, views.py.</span></p>
<div><span style="font-size: large;"><br />
</span><span style="font-size: large;">7. 在 Django-nonrel testapp 的 project folder 下 &#8220;python manage.py runserver&#8221;, &#8220;python manage.py startapp polls&#8221; ㄧ樣可以成功 (testapp 中用的 Django 版號, 內容都與原始 Django 不同, 不是理所當然可以成功).</span><br />
<span style="font-size: large;"></span><br />
<a name="more"></a><span style="font-size: large;">8. 定義你的 data models (polls/models.py), and activate them.</span></div>
<div><span style="font-size: large;"><br />
</span><span style="font-size: large;">9. &#8220;python manage.py syncdb&#8221; 產生 model tables (Django-nonrel testapp 不用)</span></div>
<div><span style="font-size: large;"><br />
</span></div>
<div><span style="font-size: large;">10. 下 &#8220;python manage.py shell&#8221;, 他會開啟 Python shell 同時設定 &nbsp;DJANGO_SETTINGS_MODULE. 在此環境下可以使用 Django API. Tutorial 有說可以外部先設定 DJANGO_SETTINGS_MODULE (ex. mysite.settings), 之後可以直接下 &#8220;python&#8221; 進入 shell, 但目前不採用這樣配置, 因為多專案時設定 DJANGO_SETTINGS_MODULE 會有一些麻煩.</span></div>
<div><span style="font-size: large;"><br />
</span></div>
<div><span style="font-size: large;">11. 同樣試一下 Django-nonrel testapp, 依照 <a href="https://developers.google.com/appengine/articles/django-nonrel">https://developers.google.com/appengine/articles/django-nonrel</a></span><br />
<span style="font-size: large;">&#8220;Here is the resulting content for the models.py file:&#8230;&#8221;&nbsp;設定 models.py. 並且試用 Django API, 成功.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">12. 在 polls.admin 註冊在 admin 要出現的界面. 進入 admin 編輯 polls. For native Django, it&#39;s ok. For Django-nonrel testapp, polls 中沒有 admin.py, 進入 admin 後當然也沒有顯示 polls app 中的 objects. 但用 Django API 確認上一步輸入的 data 還在, 查詢了一下, 在 djangotoolbox/admin.py 註冊是 ok 的.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">13. 接著在 project_folder/urls.py 加上你的 URL map, 在 project_folder/polls/urls.py 加上你的 URL map, project_folder/polls/views.py 加上你 URL handler function. 同時也許需要在 project_folder/polls/templates/ 中加上 html files. &#8220;views.py&#8221; 雖然名稱是 views, 但是以 MVC 架構來說, 它更像是 controller 的角色.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">Additional ref:</span><br />
<a href="https://developers.google.com/appengine/articles/app-engine-patch?hl=zh-TW"><span style="font-size: large;">https://developers.google.com/appengine/articles/app-engine-patch?hl=zh-TW</span></a></p>
</div>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google App Engine (4) : Python, Django</title>
		<link>https://blog.yuyansoftware.com.tw/2013/12/google-app-engine-4-python-django/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sun, 15 Dec 2013 14:00:00 +0000</pubDate>
				<category><![CDATA[網路科技]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2013/12/15/google-app-engine-4-python-django/</guid>

					<description><![CDATA[Google Cloud SQL 是 non-relational database, 而 Django 本身 &#8230; ]]></description>
										<content:encoded><![CDATA[<p><span style="font-size: large;">Google Cloud SQL 是 non-relational database, 而 Django 本身是只支援 traditional databases, 所以 Django 要上 GAE 的話, 要注意的是原始 Django framework 不能再用了, 要改用 Django-nonrel 這個專案.</span><br />
<a href="https://github.com/django-nonrel/django"><span style="font-size: large;">https://github.com/django-nonrel/django</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">另外要注意的是, 目前不管是 django-nonrel 的 testapp</span><br />
<a href="https://github.com/django-nonrel/django-testapp"><span style="font-size: large;">https://github.com/django-nonrel/django-testapp</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">還是 Google Cloud Platform 的 django-skeleton</span><br />
<a href="https://github.com/GoogleCloudPlatform/appengine-django-skeleton"><span style="font-size: large;">https://github.com/GoogleCloudPlatform/appengine-django-skeleton</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">都是用 execute_manager 這個 function, 在目前 Django 版本 (1.6) 已經不支援它了. 所以就單純化問題來說, 電腦最好不要安裝新版 Django. 安裝 django-nonrel/testapp 與 Google Cloud Platform/django-skeleton 時下載相依檔案時會下載 django-nonrel 的 1.4 版 (其他相依模組也是 1.4 版).</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">django-nonrel/testapp 與 Google Cloud Platform/django-skeleton 的差異? django-skeleton 的 app.yaml 有加 comment. 如果不算 comment 或 README 的話, 兩個 project 算是相同. 接著分析一下上述專案的架構, 它包含5個 app</span><br />
<span style="font-size: large;">autoload</span><br />
<span style="font-size: large;">dbindexer</span><br />
<span style="font-size: large;">django</span><br />
<span style="font-size: large;">djangoappengine</span><br />
<span style="font-size: large;">djangotoolbox</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">程式進入點 djangoappengine.main.application 位於 djangoappengine/main/__init__.py</span><br />
<span style="font-size: large;">application = WSGIHandler()</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">launch 起來看到的頁面是 /templates/home.html, 依照 Django 的架構, 由 /url.py 所指定. Nice article:</span><br />
<span style="font-size: large;"><a href="http://blog.wu-boy.com/2009/04/django-web-framework-django-%E5%88%9D%E9%9A%8E%E5%AD%B8%E7%BF%92%E5%BF%83%E5%BE%97/">http://blog.wu-boy.com/2009/04/django-web-framework-django-%E5%88%9D%E9%9A%8E%E5%AD%B8%E7%BF%92%E5%BF%83%E5%BE%97/</a></span></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google App Engine (3) : Python</title>
		<link>https://blog.yuyansoftware.com.tw/2013/11/google-app-engine-3-python/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sat, 16 Nov 2013 13:46:00 +0000</pubDate>
				<category><![CDATA[網路科技]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2013/11/16/google-app-engine-3-python/</guid>

					<description><![CDATA[嘗試分析一下這個 GAE 基礎 sample 的架構 https://github.com/GoogleClo &#8230; ]]></description>
										<content:encoded><![CDATA[<p><span style="font-size: large;">嘗試分析一下這個 GAE 基礎 sample 的架構</span><br />
<a href="https://github.com/GoogleCloudPlatform/appengine-guestbook-python" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://github.com/GoogleCloudPlatform/appengine-guestbook-python</span></a><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">他是教學網頁(大概是從這一頁開始)</span><br />
<a href="https://developers.google.com/appengine/docs/python/gettingstartedpython27/handlingforms" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://developers.google.com/appengine/docs/python/gettingstartedpython27/handlingforms</span></a><br />
<span style="font-size: large;">的範例程式碼.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">首先看 app.yaml. 其中</span></p>
<pre>- url: /.*
  script: guestbook.application
</pre>
<p><span style="font-size: large;">說明會有一個 &#8220;guestbook&#8221; module (guestbook.py), 裡面會有一個 &#8220;application&#8221; object 當作 request handler.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">另外 app.yaml 中</span></p>
<pre>libraries:
- name: webapp2
  version: latest
- name: jinja2
  version: latest
</pre>
<p><span style="font-size: large;">指出這個 application 中使用 webapp2, jinja2 兩個 library (jinja2 是 templating engine). 使用 jinja2 可以將一大堆 html 從 guestbook.py 中切開 (此例是放在 index.html, 使用了 bootstrap front-end framework).</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">Python NDB 的部分主要是用在 request handling module (guestbook.py). By</span><br />
<a href="https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingdatastore" target="_blank" rel="noopener noreferrer"><span style="font-size: large;">https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingdatastore</span></a><br />
<span style="font-size: large;">為了要有效率的 query data, Google Datastore 建議要用 custom index for some queries, 在此例中, 宣告在 index.yaml. Datastore 的部分我覺得是比較艱澀難懂, 留在之後再研究.</span></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google App Engine (2) : PHP, WordPress</title>
		<link>https://blog.yuyansoftware.com.tw/2013/10/google-app-engine-2-php-wordpress/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sun, 27 Oct 2013 06:03:00 +0000</pubDate>
				<category><![CDATA[網路科技]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2013/10/27/google-app-engine-2-php-wordpress/</guid>

					<description><![CDATA[最近由 Windows 轉到 Mac OS X, GAE 的開發環境又要重新設定. 參考了 http://ww &#8230; ]]></description>
										<content:encoded><![CDATA[<p><span style="font-size: large;">最近由 Windows 轉到 Mac OS X, GAE 的開發環境又要重新設定. 參考了 <a href="http://www.saick.net/blog/2013/06/07/mysql-for-macosx-an-zhuang-he-ji-ben-cao-zuo/">http://www.saick.net/blog/2013/06/07/mysql-for-macosx-an-zhuang-he-ji-ben-cao-zuo/</a>&nbsp;</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">終於成功的 create local database. 接著下 &#8220;AppEngine_PHP_SDK/dev_appserver.py THE_APP_DIR/&#8221;</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">卻出現了找不到 php-cgi 的 error (The path specified with the &#8211;php_executable_path flag () does not exist). Google 了一下有人有一樣的問題&nbsp;</span><span style="font-size: large;"><br />
<a href="http://stackoverflow.com/questions/16680729/google-app-engine-php-running-on-mac">http://stackoverflow.com/questions/16680729/google-app-engine-php-running-on-mac</a></span></p>
<p>搜尋了一下, 似乎沒有解法, 資訊也不多. 後來發現從<br />
<span style="font-size: large;"><a href="https://code.google.com/p/googleappengine/downloads/list">https://code.google.com/p/googleappengine/downloads/list</a></span><br />
<span style="font-size: large;">download 的 1.8.6 PHP SDK 會有以上問題, 但從</span><br />
<span style="font-size: large;"><a href="https://developers.google.com/appengine/docs/php/gettingstarted/installingmac">https://developers.google.com/appengine/docs/php/gettingstarted/installingmac</a></span><br />
<span style="font-size: large;">頁面上提示的 dmg 安裝包並不會發生這個問題.</span><br />
<span style="font-size: large;"></span><br />
<a name="more"></a><span style="font-size: large;">GAE 連接 local MySql DB 會有問題, 嘗試了很久, 應該是 bug, 有人有一樣的問題</span><br />
<span style="font-size: large;"><a href="http://stackoverflow.com/questions/19132196/database-errors-when-running-wordpress-on-google-app-engine/19209375#19209375">http://stackoverflow.com/questions/19132196/database-errors-when-running-wordpress-on-google-app-engine/19209375#19209375</a></span></p>
<p><span style="font-size: large;">直接嘗試上傳部署是成功的, command &#8220;appcfg.py update THE_APP_DIR/&#8221;, 結果在 (因為這個 application 會持續使用 Google Cloud SQL, 我把它 disable 掉了)</span><br />
<span style="font-size: large;"><a href="http://larrys-matcha-waffle.appspot.com/">http://larrys-matcha-waffle.appspot.com/</a></span></p>
<p><span style="font-size: large;">掙扎了一會, 終於把 Google Cloud Storage 與 App Engine 的合作弄好了. App Engine 一定要有 GCS (Google Cloud Storage) 才能上傳多媒體檔案. GCS 觀念上要釐清: 他是可以支援多個 application 的, GCS 的計價也是獨立計算.</span><br />
<span style="font-size: large;"><br />
</span><span style="font-size: large;">其實整體問題還很多, 參考的 link 記錄一下</span><br />
<a href="http://michaelsync.net/2013/10/27/migrating-the-existing-blog-to-google-app-engine-php-runtime-is-not-that-simple"><span style="font-size: large;">http://michaelsync.net/2013/10/27/migrating-the-existing-blog-to-google-app-engine-php-runtime-is-not-that-simple</span></a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google App Engine (1)</title>
		<link>https://blog.yuyansoftware.com.tw/2013/05/google-app-engine-1/</link>
		
		<dc:creator><![CDATA[Larry]]></dc:creator>
		<pubDate>Sat, 04 May 2013 11:49:00 +0000</pubDate>
				<category><![CDATA[網路科技]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<guid isPermaLink="false">http://test234.yuyansoftware.com.tw/2013/05/04/google-app-engine-1/</guid>

					<description><![CDATA[一般所謂的雲端服務分為 SaaS (Software as a Service)，PaaS (Platform &#8230; ]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">一般所謂的雲端服務分為 SaaS (Software as a Service)，PaaS (Platform as a Service)，和 IaaS (Infrastructure as a Service)。而本篇主角 Google App Engine 則是 PaaS 的代表之一。<a rel="noreferrer noopener" href="https://developers.google.com/appengine/training/intro/whatisgae" target="_blank">https://developers.google.com/appengine/training/intro/whatisgae</a></p>



<p class="wp-block-paragraph">這兩天抽空將 GAE (Google App Engine) 的流程走了一遍，包含佈署 (deploy) 上線。<a rel="noreferrer noopener" href="https://developers.google.com/appengine/docs/java/gettingstarted/" target="_blank">https://developers.google.com/appengine/docs/java/gettingstarted/</a></p>



<p class="wp-block-paragraph">專案資料夾主要分為 src 與 war。src 當然就是放你的原始碼，war 資料夾在最終會上傳佈署，其中包含：css、html、xml、jsp、多媒體資源檔、compiled byte-code，和相依的 jar libraries。</p>



<p class="wp-block-paragraph">Eclipse &#8220;Web Application Project&#8221; 模版 &#8220;war&#8221; folder 裡 &#8220;index.html&#8221; 為網站的入口頁面。</p>



<p class="wp-block-paragraph">&#8220;warWEB-INF&#8221; 裡的 &#8220;web.xml&#8221; 為 &#8220;web application deployment descriptor&#8221;。其宣告了 &lt;servlet&gt;，&lt;servlet-mapping&gt;，和 &lt;welcome-file-list&gt;。</p>



<p class="wp-block-paragraph">&lt;welcome-file-list&gt; 的 default 值是 &#8220;index.html&#8221;。根據：<br><a href="https://developers.google.com/appengine/docs/java/gettingstarted/creating" target="_blank" rel="noreferrer noopener">https://developers.google.com/appengine/docs/java/gettingstarted/creating</a></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>&#8220;It also says that, whenever the user fetches a URL path that is not already mapped to a servlet and represents a directory path inside the application&#39;s WAR, the server should check for a file named index.html in that directory and serve it if found.&#8221;</p></blockquote>



<p class="wp-block-paragraph">另外還有一 &#8220;appengine-web.xml&#8221;，則是 GAE 專屬，其 &lt;application&gt; 標籤是重點，須與你的 GAE application ID 同。指定 JSP 網頁的方式：<br><a rel="noreferrer noopener" href="https://developers.google.com/appengine/docs/java/gettingstarted/usingjsps" target="_blank">https://developers.google.com/appengine/docs/java/gettingstarted/usingjsps</a></p>



<p class="wp-block-paragraph">開發過程主要就是新增 JSP 檔和在 &#8220;web.xml&#8221; 指定你 JSP 檔的 mapping URL。當然 JSP 檔可以跟 Java servlet 做互動。</p>



<p class="wp-block-paragraph">GAE 提供了免費 (或是一定費用) 的虛擬 server，免去採購 server，設定 server，建置維護網站運行環境所需的人力與金錢。</p>



<p class="wp-block-paragraph">附註：GAE 目前還不成熟，tool chain 的建置不是很順暢，很多東西要 google 一陣子才知道做法。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
