Pages

顯示具有 雲端服務 標籤的文章。 顯示所有文章
顯示具有 雲端服務 標籤的文章。 顯示所有文章

2023年5月11日 星期四

【GCP 】Region HTTP TO HTTPS Load Balance 設定方式(台灣)

目的:在GCP上建立台灣版的HTTP轉HTTPS的負載平衡器

步驟:

1. 進入GCP Console

2. 點選右上角的【啟用Cloud Shell】

3. 點選右下角【開啟編輯器】

4. 點選【File】➔【New File】

5. 貼上以下內容(相關名稱與domain請自行修改)


kind: compute#urlMap
name: example-http-to-https
defaultUrlRedirect:
  redirectResponseCode: MOVED_PERMANENTLY_DEFAULT
  httpsRedirect: True
tests:
- description: Test with no query parameters
  host: example.com
  path: /
  expectedOutputUrl: https://example.com/
  expectedRedirectResponseCode: 301

6. 點選【File】➔【Save As...】➔ 選擇tmp目錄➔存檔名稱為:web-map-http.yaml

7. 點選右上角X ➔ 離開編輯器

8. 到【VPC Network】➔【IP Address】➔尋找HTTPS負載平衡器,建立的HTTPS IP名稱。

9. 點選右上角的【啟用Cloud Shell】

10. 執行以下指令(請依自行設定的區域、IP名稱自行修改)

gcloud compute url-maps import example-http-to-https --source /tmp/web-map-http.yaml --region=asia-east1
gcloud compute url-maps describe example-http-to-https --region=asia-east1
gcloud compute target-http-proxies create http-lb-proxy --url-map=example-http-to-https --region=asia-east1
gcloud compute forwarding-rules create http-content-rule \
           --load-balancing-scheme=EXTERNAL_MANAGED \
           --address=uat-example-https2 \
           --network-tier=STANDARD \
           --region=asia-east1 \
           --target-http-proxy=http-lb-proxy \
           --target-http-proxy-region=asia-east1 \
           --ports=80

11. 完成後,網域站台即可透過HTTP協定轉到HTTPS。

2023年4月29日 星期六

【GCP】靜態網頁建置

 GCP上除了使用VM架設Web Server建置靜態網頁外,另外也提供了其他方式可以不使用VM的情況下,將html檔案,放置在雲端儲存體內,透過相關設定,來建構靜態網頁網站,但相關流程較為複雜,但因為是Serverless的架構,因此穩定度會高很多。

 

在GCP Console下,透過下面六個步驟(範例域名:example.com.tw),即可建置一個靜態網站。

 

1. 新增一個example.com.tw名稱的bucket

2. Edit access > Access-control -> Fine-grained: Object-level ACLs enabled

3. 上傳檔案

4. 使用cloud console輸入:gsutil -m acl set -R -a public-read gs://example.com.tw

5. 檢查檔案權限都設定為public

6. 設定@CNAME DNSc.storage.googleapis.com

 

步驟參考:https://ikala.cloud/cloud-storage-application-website/

 

 網站建置完後,如果要套用HTTPS連線,可以依照以下步驟進行:

 

SSL設定:https://www.minwt.com/website/server/21585.html

 


結論:

1. 設定較為複雜。

2. 費用跟架設便宜的VM沒差多少。

3.  更新檔案較不方便。

4. 穩定性與安全性較高。

5. 不用擔心硬體效能。

2023年4月28日 星期五

【AWS】SQL Server服務備份與還原資料

AWS上面RDS的SQL Server雖然有提供線上的備份服務,但是在導入資料到本地端的開發環卻是比較困難的,因此下方影片提供了相關的步驟來讓大家可以照步驟來進行備份還原AWS上的SQL SERVER的服務資料。

預先準備:

1. AWS S3的空間。

2. SQL Server Manager Stoudo管理工具