之前在linux上配置ssl,直接yum install mod_ssl再寫幾個路徑就解決了。算是所有配置過程中最簡單的。
用phpstudy最新版本V8的集成環境,碰到了http解析,https不解析的情況,於是回頭看了一遍https工作原理,接着找日誌中的錯誤記錄。於是發現證書對應的服務器域名和我輸入的不匹配。
錯誤:
server certificate does NOT include an ID which matches the server name
於是我用之前隨手註冊的ssl證書替換了phpstudy提供的證書,但是https寫一下php依然不解析腳本,直接輸出亂碼。
想到http的虛擬主機中多了兩句:
FcgidInitialEnv PHPRC "*:/phpstudy_pro/Extensions/php/php7.3.4nts"
AddHandler fcgid-script .php
FcgidWrapper "*:/phpstudy_pro/Extensions/php/php7.3.4nts/php-cgi.exe" .php
在https對應的虛擬主機中的<Directory>添加了這三句,https訪問就正常了。
Listen 443
SSLStrictSNIVHostCheck off
SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL
SSLProtocol all -SSLv2 -SSLv3
<VirtualHost *:443>
......
</VirtualHost>