windows下安裝apache并配置ssl全過程
發(fā)布時(shí)間:2014-04-16 16:49:34 作者:佚名
我要評論

這篇文章主要介紹了windows下安裝apache及配置ssl的全過程,包括配置ssl的常見問題,需要的朋友可以參考下
步驟1:配置 APACHE以支持SSL
找到下面兩行去掉前面的注釋 #
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
步驟2: 為網(wǎng)站服務(wù)器生成證書及私鑰文件
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out server.key 1024
生成一個(gè)server.key
步驟3:生成簽署申請
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl req -new -out server.csr -key server.key -config ..\conf\openssl.cnf
此時(shí)生成簽署文件 SERVER.CSR
步驟4:使用OPENSSL生成CA私鑰
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out ca.key 1024
多出CA.key文件
步驟5:利用CA的私鑰產(chǎn)生CA的自簽署證書
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
步驟6:在bin目錄下新建demoCA目錄,在demoCA下新建index.txt,newcerts,serial 目錄結(jié)構(gòu)如下
demoCA
|--index.txt(文本,內(nèi)容為空)
|--newcerts(文件夾)
|--serial(文本,內(nèi)容為 01)
步驟7:準(zhǔn)備為網(wǎng)站服務(wù)器簽署證書
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
生成 server.crt文件
步驟8:將 server.crt server.key復(fù)制到 conf文件夾下
------------------配置ssl常見問題---------------------
win7系統(tǒng)64位在配置過程中,在重啟apache時(shí)可能會(huì)出現(xiàn)問題
問題1:apache重啟失敗,報(bào)錯(cuò)信息Syntax error on line 62 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/extra/httpd-ssl.conf:
SSLSessionCache: Invalid argument: size has to be >= 8192 bytes
解決辦法:
將conf\extra\httpd-ssl.conf中61-63行修改成下面這樣即可SSLSessionCache "dbm:C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache"
# SSLSessionCache "shmcb:C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
找到下面兩行去掉前面的注釋 #
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
步驟2: 為網(wǎng)站服務(wù)器生成證書及私鑰文件
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out server.key 1024
生成一個(gè)server.key
步驟3:生成簽署申請
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl req -new -out server.csr -key server.key -config ..\conf\openssl.cnf
此時(shí)生成簽署文件 SERVER.CSR
步驟4:使用OPENSSL生成CA私鑰
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out ca.key 1024
多出CA.key文件
步驟5:利用CA的私鑰產(chǎn)生CA的自簽署證書
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
步驟6:在bin目錄下新建demoCA目錄,在demoCA下新建index.txt,newcerts,serial 目錄結(jié)構(gòu)如下
demoCA
|--index.txt(文本,內(nèi)容為空)
|--newcerts(文件夾)
|--serial(文本,內(nèi)容為 01)
步驟7:準(zhǔn)備為網(wǎng)站服務(wù)器簽署證書
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
生成 server.crt文件
步驟8:將 server.crt server.key復(fù)制到 conf文件夾下
------------------配置ssl常見問題---------------------
win7系統(tǒng)64位在配置過程中,在重啟apache時(shí)可能會(huì)出現(xiàn)問題
問題1:apache重啟失敗,報(bào)錯(cuò)信息Syntax error on line 62 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/extra/httpd-ssl.conf:
SSLSessionCache: Invalid argument: size has to be >= 8192 bytes
解決辦法:
將conf\extra\httpd-ssl.conf中61-63行修改成下面這樣即可SSLSessionCache "dbm:C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache"
# SSLSessionCache "shmcb:C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
相關(guān)文章
XAMPP中Apache能啟動(dòng)但MySql無法啟動(dòng)解決方法
在安裝XAMPP 時(shí),安裝成功后,打算啟動(dòng)XAMPP。Apache順利啟動(dòng),但是MySql怎么都啟動(dòng)不了,這該怎么解決呢,下面小編就為大家介紹一下吧2014-11-05安裝xampp后apache無法啟動(dòng)的原因及解決方法
一般在windows XP或windows 7中,剛安裝完xampp時(shí),apache服務(wù)器是啟動(dòng)不了的。這個(gè)原因有很多,下面我來一一細(xì)說,以及相關(guān)的解決的辦法,希望可以對大家有所幫助的2014-11-05windows下作為應(yīng)用程序啟動(dòng)apache的方法
這篇文章主要介紹了windows下作為應(yīng)用程序啟動(dòng)apache的方法,需要的朋友可以參考下2014-04-25- Windows server 2003服務(wù)器上安裝有默認(rèn) IIS 6和Apache兩個(gè)服務(wù)器,IIS運(yùn)行的一個(gè).net程序,apache運(yùn)行php程序,現(xiàn)在想讓它們同時(shí)都能通過80端口訪問,設(shè)置起來還比較簡單2014-03-12
wampserver安裝多個(gè)版本php、mysql、apache
作為Web開發(fā)人員,在機(jī)器上安裝不同版本的php,apache和mysql有時(shí)是很有必要的,下面是安裝步驟2014-03-12apache服務(wù)器啟動(dòng)失敗 無法啟動(dòng)的解決辦法
apache服務(wù)器啟動(dòng)失敗怎么回事?造成apache無法正常啟動(dòng)的主要原因一般是其默認(rèn)80端口被其他服務(wù)占用,產(chǎn)生沖突,下面小編就為大家介紹apache無法啟動(dòng)時(shí)的解決辦法,來看看2015-12-18