Hostinger是熱門的免費主機商,
付費主機額外提供新加坡機房可以提升台灣地區訪問性能。
近期Hostinger改善SSL加密的安全性(SSL Labs安全檢測結果為A級),
並啟用全新設計的https官網,
不斷地優化中文站點的瀏覽體驗。

針對SSL憑證的簽發需求,可以使用廉價的Comodo憑證外,
也能手動簽發Let’s encrypt憑證,
Hostinger付費主機提供SSH連接終端介面的功能,
即可在主機完成Let’s encrypt驗證與簽發的動作。

Hostinger中文官網 https://www.hostinger.com.hk

hostingernewsite

Hostinger連接SSH終端簽發Let’s encrypt官方教學(英文)
https://www.hostinger.com/tutorials/ssl/how-to-install-free-ssl-from-lets-encypt-on-shared-hosting

請先到Hostinger的虛擬主機面板開啟SSH連接功能

hostingerlessl1

開啟SSH後按下更新完成配置,並留意下方顯示的SSH連接資訊。

hostingerlessl2

透過PuTTY連接Hostinger終端。

hostingerlessl3

先將需要申請Let’s encrypt的域名綁定到Hostinger主機並完成DNS解析

請在本地端透過SSH連接Hostinger終端介面
須留意Hostinger主機帳戶的使用者名稱、對應域名的路徑、欲使用的Email地址
下列示範以
bcx.com、test.bcx.com兩個網域以及帳戶名稱u425715402、[email protected]為例

下載安裝套件

git clone https://github.com/kelunik/acme-client && cd acme-client

分別鍵入以下指令

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');" --no-dev

安裝composer

php composer.phar install

設定Let’s encrypt要使用的信箱(請將[email protected]修改成需要使用的Email)

php bin/acme setup --server letsencrypt --email [email protected]

簽發Let’s encrypt憑證
(請將u425715402修改成實際Hostinger主機的帳號,並留意域名綁定所對應的檔案目錄位置)

php bin/acme issue --server letsencrypt --domains bcx.com:test.bcx.com --path /home/u425715402/public_html:/home/u425715402/public_html/test

配置到高級Cron Jobs定期renew憑證,建議選擇每個月一次的週期

php acme-client/bin/acme issue --server letsencrypt --domains bcx.com:test.bcx.com --path /home/u425715402/public_html:/home/u425715402/public_html/test

簽發成功後,
SSL憑證會存放在/acme-client/data/certs底下,
取出fullchain.pem與key.pem檔案貼到Hostinger主機的SSL面板完成SSL部屬。

可透過Symantec與SSL Shopper、SSL LABS檢查憑證安裝是否正確

https://cryptoreport.websecurity.symantec.com/checker/views/certCheck.jsp
https://www.sslshopper.com/ssl-checker.html
https://www.ssllabs.com/ssltest/

由於Hostinger無法自動部屬Let’s encrypt,可透過LetsMonitor.org提醒憑證到期

https://letsmonitor.org

Hostinger手動簽發免費Let’s encrypt憑證教學
標籤: