【GCP】OpenLiteSpeed-WordPress 【最速開箱安裝紀錄】

分享一下最近剛好在測試主機時發現號稱比NGINX還要快的Web系統架構【 OpenLiteSpeed 】有興趣的朋友自己去官網看 https://openlitespeed.org/
本來我是自己用VirtualBox上練習安裝一台 OpenLiteSpeed 。
但不小心參加WordPress台北小聚時剛好有小聚王和微軟Azure乾媽大大來講一個主題,意外被我發現Azure竟然出了 OpenLiteSpeed on WordPress這個虛擬主機的版本。 隔天我就想該不會GCP也有了!! 萬歲萬歲^^又有東西可以玩嚕

逆看看,11/26看到11/27又有更新了 這東西真的很新。

系統資訊
啟動openlitespeed-wordpress
啟動openlitespeed-wordpress

價格資訊: 預估費用是以美國中部地區在 30 天內 24 小時全日無休的使用量計算而得 (含持續使用折扣)。 每月5.13美金 等等調整成台灣主機看看。

價格資訊

主機基本規格設定

因為是這次是紀錄如何安裝,所以我就先選擇3個規格的費用截圖給大家看。
主機位置都是台灣asia-east1-b,規格微型f1-macro 1core共用vCPU、0.6G記憶體、 10G標準硬碟。每月5.10美金 (SSD:6.30)

f1-macro

g1-small :1core共用vCPU、1.7G記憶體、 10G標準硬碟。每月15.83美金(SSD:17.03)

g1-small

n1-standard-1:1vCPU、3.75G記憶體、 10G標準硬碟。每月28.60美金 (SSD:29.80)

n1-standard- 1

以上價格是我這個時間點查到了,真正的價格還是以使用者當下申請為主。

防火牆設定

這邊我會建議把Allow TCPllow TCP port 7080和prot22 設定一組白單IP會比較安全,不然後台7080和SSH22全都開放非常危險。
我是設定公司現在用的IP上去,可以設定多組。
當然如果沒有使用就把勾勾拿掉會比較安全,要用再開啟也可以。

按下確定部屬後就等一下嚕。

完成部屬後就會變成這樣嚕,右邊會有GCP提供的IP和後台網址。

但是這個時候直接點會跑出這個畫面。
其實還沒有設定好,點一下 Quickstart guide
會開一個教學網站,依據步驟去設定即可。

回到GCP的控制台,點選一下SSH

SSH畫面就有一些設定需要輸入一下了,依據要的資料設定即可。
而且每次登入SSH可以看到登入當下的系統資源使用狀態
CPU已經用了84.9321% …果然是f1 免費等級,真心如果要正式使用不可以用這個去跑喔,會死人的。
0.6G的RAM已經用了49.91%,空間已經用了24% ??? 好肥

先輸入這個WordPress要使用的網址,我自己已經有開了一個測試設定用的網址,這樣才不會卡住畫面。

安裝設定
(If you are using top level (root) domain, please include it with www. so both www and root domain will be added)
(ex. www.domain.com or sub.domain.com). Do not include http/s.

Your domain: ols.bruce-blog.tw
The domain you put is: ols.bruce-blog.tw
Please verify it is correct. [y/N]  y   

Domain has been added into OpenLiteSpeed listener.

Do you wish to issue a Let's encrypt certificate for this domain? [y/N]y
ols.bruce-blog.tw check PASS
Please enter your E-mail: xxxx@gmailc.om   <--輸入你的mail
The E-mail you entered is: xxxx@gmail.com
Please verify it is correct: [y/N] ySaving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for ols.bruce-blog.tw
Using the webroot path /var/www/html for all unmatched domains.
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/ols.bruce-blog.tw/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/ols.bruce-blog.tw/privkey.pem
   Your cert will expire on 2020-02-25. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le


certificate has been successfully installed...
Update certbot cronjob hook
Certbot hook update success
Do you wish to force HTTPS rewrite rule for this domain? [y/N]y

Enjoy your accelarated OpenLiteSpeed server.
Do you wish to update the system now? This will update the web server as well. [Y/n]? y
Update Starting...
#######################   (100%)
Update complete
Your system is up to date

大致上就是:輸入網址、Y、Y、輸入Email、Y、Y。結束

然後在開啟 https://104.199.232.127 就會跳到安裝WordPress的安裝畫面了。

安裝WordPress
安裝WordPress
安裝WordPress
安裝WordPress
安裝完成

用HTOP看一下系統即時的使用狀態,不意外。 改天再裝一台g1-small看看。

看一下預設安裝的佈景主題: ?? (因為還沒更新到WordPress5.3) 先更新下

預設佈景主題

看一下預設安裝的外掛有哪些?

預設外掛1
預設外掛1
預設外掛2
預設外掛2

如何知道預設環境的DB Password?

指令在這邊 記得查出來後要記錄起來喔 (要先切換成root權限喔)
cat /home/ubuntu/.db_password (root)
cat /home/ubuntu/.litespeed_password

WebAdmin如何登入

LiteSpeed Web Admin URL: https://Server_IP:7080
密碼如何查? Access: cat /home/ubuntu/.litespeed
帳號預設是:admin
開啟控制台的畫面大致是長這樣

openlitespeed後台

Htop的狀態其實記憶體變化,其實都維持在400M以內
目前也都有安裝一些外掛(16個、4個沒開)、但是主題只有一個(Twenty Twenty)

Htop安裝的狀態

Load Lmpact 測試一個50人的壓力測試(改天要把我的網站移到這邊測試看看)

其它更詳細的設定大家就看一下官方的文件去調整嚕
https://docs.litespeedtech.com/cloud/wordpress/#quick-start
對嚕我剛剛還發現/phpmyadmin 是可以直接就看到畫面。
提醒一下
記得要鎖起來或起來,因為最近有0day漏洞!!設定完畢後記先關起來比較安全。 (我自己是先把phpmyadmin目錄先換名稱)

這篇文章發佈後,這台主機我也砍掉了,因為要再練習其它東西,重新再申請一次了。畢竟還不是很熟悉還要多查一些資料感覺功能很多但又和Cyber panel的介面有點差異。