[Linux] Web App Server(網頁伺服器)OS系統建置架構指南
Intro 建置Web Application Server的System Pattern。 服務目錄 使用/srv作為存放App site目錄 srv/ 在磁區切割上,即以此目錄做另外切割以分離OS與App的相互影響,而nginx目錄皆走預設只在Prod site指定Document Root。
全端開發技術 | Full-Stack Blog
Intro 建置Web Application Server的System Pattern。 服務目錄 使用/srv作為存放App site目錄 srv/ 在磁區切割上,即以此目錄做另外切割以分離OS與App的相互影響,而nginx目錄皆走預設只在Prod site指定Document Root。
Intro Windows 10 更新太XX 注意! Windows 10自動更新的機制不斷再更新,本教學也會持續更新。 第三方關閉自動更新軟體:StopUpdates10 關閉服務(Service) 服務(Services) > Windows Update > 關閉停用 + 復原不動作0重試 服務(Services) > Windows Update Medic Service > 關閉停用 Service服務有權限鎖,以系統管理員執行REG add “HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc” /v “Start” /t REG_DWORD /d “4” /f 設定自動更新模式 可修改為停用或提醒下載模式 執行gpedit.msc: 電腦設定 > […]
Intro Traceroute – Wikipedia 可顯示封包在IP網路經過的路由器的IP位址。 Windwos平台指令:tracert Linux Linux平台指令:traceroute or tracepath traceroute(8) — Linux manual page Linux 可以額外安裝 traceroute 套件,與內建 tracert 不相同 $ traceroute www.google.com // TCP on port 443 $ traceroute -T -p 443 www.google.com MacOS 原生的traceroute不支援 TCP protocol,可以利用 Homebrew […]
Intro 常見的國家語系代碼如en-US, zh-TW,是遵照RFC 3066定義。 RFC 3066 簡而言之,使用ISO 639搭配ISO 3166組合而成: [ISO 639-2]-[ISO 3166-1] 產生如en-US, zh-TW codes。 代碼查詢表 – Code Tables ISO 639-2 – 語系表 ISO 3166-1 – 國別表 ISO 15924 – 地區書寫表 RFC 3066 – 完整語系國別表(含ISO 15924定義) Reference IETF語言標籤 – IETF […]
Intro 官網文件:Internationalization 語系代碼:[i18n] 淺談Internationalization – Language Identifiers (RFC 3066) 架構範例 別於官網以主要語系(英文)為sourceLanguage,本章範例以Key的架構去定義語系(也就是Message是指定一個Key必經轉譯)。 Configuration return [ // set target language to be English ‘language’ => ‘en-US’, // set source language to be a customized key which means it will always translate. ‘sourceLanguage’ […]
Intro MySQL Benchmark方法指南。 效能測試 取得PROFILE資料檢測Query: SET profiling=1;<query>;SHOW PROFILE; 從mysqlDB測測CPU: SELECT DISTINCT Transition_type_id FROM `time_zone_transition`; 連線測試 MySQL目前有個有趣的連線Latency問題,可參考:[MySQL] 如何佈署Database最佳連線路由 – phpMyAdmin建議走本機或內網 這邊提供測試方法(透過mysql client): 預裝好的選mysqldatabase來測試: use mysql; 找最大的time_zone_transition來測: SELECT * FROM `time_zone_transition`; 結果範例最後的資訊帶有總體來回時間: 120208 rows in set (0.08 sec) 交叉測試便可知越遠的client connection時間越久。
主動語態範例 時態 簡單式 進行式 完成式 完成進行式 現在 taketakes am takingare takingis taking have takenhas taken have been takinghas been taking 過去 took was takingwere taking had taken had been taking 未來 shall takewill take shall be takingwill be taking shall […]
Intro CodeIgniter User Guide bcit-ci/CodeIgniter Router Core: system/core/Router.php 由Codeigniter core class執行裝載為$RTR。 Uri中,Query String(Uri)的載入是在__construct()執行_set_routing()後,分別設定完成以下Properties: class – Controller name method – Action name directory – Controller directory if exist _set_routing() => _parse_routes() > _set_request() or _set_default_controller() 所以Router需裝載Uri並透過Uri取得segments注入設定。 Uri Core: system/core/Uri.php __construct()即會解析Uri(uri_string)至segments:_set_uri_string() Uri拿取方法uri_protocol預設就是使用:_parse_request_uri() […]
Intro 一般應用在使用如Xampp的php想要有alias指令,或像Cygwin執行檔環境變數問題。 Windows10環境變數設定選單: “My Computer” -> Properties -> Advanced -> Environment Variables 或 “Control Panel\System and Security\System” -> Advanced system settings -> Advanced -> Environment Variables 效益上就是要達到SET PATH=%PATH%;C:\your,差異在設定方式會是永久保存。 環境變數設定 可以先看到分User variables與System variables,一般我們只需要異動使用者的。 變數Path Path變數提供類似Command Alias功能, 實作上例如安裝Xampp後期待可以透過cmd輸入php,mysql等alias執行相依程式。 以PHP安裝在D:\xampp\php\目錄舉例,在環境變數設定介面選擇Path的變數進行編輯,可以新增一行: D:\xampp\php 儲存後,可以在cmd下測試輸入php -v是否有成功。
Intro CPanel的網頁伺服器是使用Apache搭建,可以支援.htaccess & php.ini的應用。 .htaccess 為Apache開啟AllowOverride後支援的檔案目錄設定檔功能,每個目錄皆能Override 以常見的轉導應用為例,.htaccess可參考以下: RewriteEngine On # 301 Redirect (Comment out) # redirect 301 / https://www.google.com # non-www redirect to www RewriteCond %{HTTP_HOST} ^yourname.com [NC] RewriteRule ^(.*)$ https://www.yourname.com/$1 [L,R=301] [Apache][.htaccess] 停用PHP – Disable PHP .htaccess file gives […]