windows下安装apache并配置ssl 附 整个配置过程的批处理脚本
2014-03-31 10:21
543 查看
步骤1:配置 APACHE以支持SSL
找到下面两行去掉前面的注释 #
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
步骤2: 为网站服务器生成证书及私钥文件
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out server.key 1024
生成一个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
此时生成签署文件 SERVER.CSR
步骤4:使用OPENSSL生成CA私钥
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out ca.key 1024
多出CA.key文件
步骤5:利用CA的私钥产生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 目录结构如下
demoCA
|--index.txt(文本,内容为空)
|--newcerts(文件夹)
|--serial(文本,内容为 01)
步骤7:准备为网站服务器签署证书
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复制到 conf文件夹下
------------------配置ssl常见问题---------------------
win7系统64位在配置过程中,在重启apache时可能会出现问题
问题1:apache重启失败,报错信息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
-------------------------apache配置ssl批处理脚本-------------------
set path=C:\Program Files
cd %path%\Apache Software Foundation\Apache2.2\bin
openssl genrsa -out server.key 1024
openssl req -new -out server.csr -key server.key -config ..\conf\openssl.cnf
openssl genrsa -out ca.key 1024
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
md demoCA
cd demoCA
md newcerts
wuauclt > index.txt
echo 01>serial
cd ..
openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
copy server.crt ..\conf\
copy server.key ..\conf\
pause
参考:
http://dufei.blog.51cto.com/382644/90532
http://www.xinotes.net/notes/note/1776/
找到下面两行去掉前面的注释 #
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
步骤2: 为网站服务器生成证书及私钥文件
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out server.key 1024
生成一个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
此时生成签署文件 SERVER.CSR
步骤4:使用OPENSSL生成CA私钥
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out ca.key 1024
多出CA.key文件
步骤5:利用CA的私钥产生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 目录结构如下
demoCA
|--index.txt(文本,内容为空)
|--newcerts(文件夹)
|--serial(文本,内容为 01)
步骤7:准备为网站服务器签署证书
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复制到 conf文件夹下
------------------配置ssl常见问题---------------------
win7系统64位在配置过程中,在重启apache时可能会出现问题
问题1:apache重启失败,报错信息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
-------------------------apache配置ssl批处理脚本-------------------
set path=C:\Program Files
cd %path%\Apache Software Foundation\Apache2.2\bin
openssl genrsa -out server.key 1024
openssl req -new -out server.csr -key server.key -config ..\conf\openssl.cnf
openssl genrsa -out ca.key 1024
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
md demoCA
cd demoCA
md newcerts
wuauclt > index.txt
echo 01>serial
cd ..
openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
copy server.crt ..\conf\
copy server.key ..\conf\
pause
参考:
http://dufei.blog.51cto.com/382644/90532
http://www.xinotes.net/notes/note/1776/
相关文章推荐
- windows下安装apache并配置ssl过程
- windows下安装apache并配置ssl全过程
- windows安装基于Apache的Subversion服务器(包括SSL配置)
- windows安装基于Apache的SVN服务器(包括SSL配置)[2007-8-19更新]
- openssl + apache + mod_ssl安装配置调试过程-
- openssl + apache + mod_ssl安装配置调试过程
- windows安装基于Apache的SVN服务器(包括SSL配置)
- WAMP(Windows、Apache、MySQL、php)安装配置过程常见问题
- openssl + apache + mod_ssl安装配置调试过程
- windows安装基于Apache的SVN服务器(包括SSL配置)[
- windows安装基于Apache的SVN服务器(包括SSL配置)
- windows安装基于Apache的SVN服务器(包括SSL配置)
- windows安装基于Apache的SVN服务器(包括SSL配置)
- Windows平台下Apache的SSL配置过程
- windows安装基于Apache的SVN服务器(包括SSL配置)
- 【转】windows安装基于Apache的SVN服务器(包括SSL配置)
- windows安装基于Apache的SVN服务器(包括SSL配置)[2007-8-19更新]
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- PHP环境搭建:Windows 7下安装配置PHP+Apache+Mysql环境教程
- Windows下配置Apache的SSL服务