WTserver (WinNMP) SSL憑證安裝實作
在安裝好WinNMP後,若你的網站需要免費的SSL憑證可參考以下方式:
先開啟command視窗
Register your account key in Let's Encrypt - Only once !
acmePhp register name@yourname.com
Generate an authorization token for the domain
acmePhp authorize www.yourname.com
Publish the authorization token in the project`s directory This step is implemented and available only on WinNMP
acmePhp publish www.yourname.com www.yourname.com
Ask the server to check your proof
acmePhp check www.yourname.com
Get the certificate!
acmePhp request www.yourname.com
Country Name (2 letter code) [AU]:TW State or Province Name (full name) [Some-State]:Taipei Locality Name (eg, city) []:Taipei Organization Name (eg, company) [Internet Widgits Pty Ltd]:hahasmile Organizational Unit Name (eg, section) []:blog Common Name (e.g. server FQDN or YOUR name) []:blog.hahasmile.com Email Address []:dorigo.tw@yahoo.com.tw Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:xxxxxxxxxxxxxxx An optional company name []:hahasmile
在\WinNMP\conf 會多了一個目錄.acemphp,代表憑證發行成功!
編輯網站的conf檔,加入
listen *:443;
ssl_certificate .acmephp/master/certs/www.yourname.com/fullchain.pem;
ssl_certificate_key .acmephp/master/private/www.yourname.com/private.pem;
重啟Ngnix,完成。
Let's Encrypt SSL 憑證三個月要更新一次,如果之後要更新憑證,除了上面的指令要重做外,請再執行
acmePhp request -q -n www.yourname.com
快到期前你會收到類似這樣的通知信 ↓
發表評論
想要留言嗎?歡迎歡迎!