2016-09-23 112 views
-1

我有xampp安裝在我的vps上。我的網站現在工作完美。但我需要運行我的網站ssl在apache上運行ssl,Xampp

我讀過很多關於它的教程,其中大部分都是一樣的。無論如何,我做了他們所說的。任何事情都不適合我。

我用ssh創建了不與CA權限的證書。這只是爲了測試。

我編輯了php.ini文件來啓用SSL擴展。

我已經編輯的httpd-ssl.conf中的httpd-vhosts.conf文件。

這裏是我的的httpd-vhosts.conf文件:

NameVirtualHost *:80 
NameVirtualHost *:443 

<VirtualHost *:80> 
ServerAdmin [email protected] 
DocumentRoot "C:/xampp/htdocs/" 
ServerName example.com 
ServerAlias www.example.com:8080 
ErrorLog "logs/example.com-error.log" 
CustomLog "logs/example.com-access.log" common 
</VirtualHost> 

<VirtualHost *:443> 
DocumentRoot C:\xampp\htdocs\ 
ServerName example.com 
<Directory C:\xampp\htdocs\n> 
AllowOverride All 
Allow from All 
</Directory> 
SSLEngine on 
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL 
SSLCertificateFile "conf/ssl.crt/server.crt" 
SSLCertificateKeyFile "conf/ssl.key/server.key" 
<FilesMatch "\.(cgi|shtml|pl|asp|php)$"> 
SSLOptions +StdEnvVars 
</FilesMatch> 
<Directory "C:/xampp/cgi-bin"> 
SSLOptions +StdEnvVars 
</Directory> 
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 
</VirtualHost> 

當我鍵入https://example.com或example.com:443網站無法打開。

任何解決方案?


更新:

下面是在日誌中apache的錯誤日誌文件:

[週五19年9月23日:09:11.355966 2016年] [SSL:警告] [PID 2616 :tid 284] AH01909:example.com:443:0服務器證書不包含與服務器名稱匹配的ID

+0

」對我不起作用。「是任何人都可以說的描述錯誤的最無用的東西。你能澄清「不行」嗎?怎麼了?你期望它發生了什麼?另外關於警告,這只是一個警告,不會阻止httpd運行。你必須嘗試的事情:1º在本地訪問並使用ip放棄dns問題,2º使CN與「ServerName」指令中的名稱相匹配的證書來擺脫該警告。 –

+0

我已經告訴過在問題結束時沒有工作。我說了我想要的。證書和配置文件中的服務器名稱相同。我不知道這是什麼錯誤。 –

+0

很明顯,證書中的CN與您定義的ServerName不匹配,如果HTTPD抱怨的話。無論如何,很高興你自己解決它。 –

回答

0

問題解決。

防火牆阻止了端口443.現在它已經打開並且沒有問題。 「