win7(64位)+apache(集成环境) 开启openssl
来源:互联网 发布:压缩至淘宝推荐画质 编辑:程序博客网 时间:2024/06/09 22:53
1、下载并安装ActivePerl
网址: http://www.activestate.com/activeperl/
ActivePerl-5.20.2.2002-MSWin32-x64-299195.msi
下载地址:http://downloads.activestate.com/ActivePerl/releases/5.20.2.2002/ActivePerl-5.20.2.2002-MSWin32-x64-299195.msi
2、下载并解压openssl
网址 http://www.openssl.org/
文件:openssl-1.0.0s.tar.gz (PGP sign) (SHA1)
下载地址:http://www.openssl.org/source/openssl-1.0.0s.tar.gz
下载后解压到指定目录,例如C:\OpenSSL
3、下载并安装Visual Studio 2015 community
https://www.visualstudio.com/downloads/download-visual-studio-vs
ISO格式太大,可以不选择这个格式,安装的时候最好选择自定义安装,不需要安装全部,只需要编译器就行
安装后选择安装目录下的:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat
4、运行VS2015 x64 本机工具命令提示符
点击Visual Studio 2015 -> Visual Studio Tools -> Windows Desktop Command Prompts ->VS2015 x64 本机工具命令提示符,并在命令行中转到OpenSSL解压的目录
5、安装
根据OPENSSL安装说明文件INSTALL.W64说明在命令行输入以下命令
> perl Configure VC-WIN64A
> ms\do_win64a
> nmake -f ms\ntdll.mak
> cd out32dll
> ..\ms\test
6、apache中启用ssl的相关配置
进入目录apache/bin的目录
1):生成密钥
命令:openssl genrsa 1024 > server.key
2): 生成证书请求文件
openssl req -config D:\Apache24\conf\openssl.cnf -new -key server.key > server.csr
下面的问题回答可以根据情况任意填写
Country Name (2 letter code) [AU]:China
string is too long, it needs to be less than 2 bytes long
Country Name (2 letter code) [AU]:ca
State or Province Name (full name) [Some-State]:bj
Locality Name (eg, city) []:beijing
Organization Name (eg, company) [Internet Widgits Pty Ltd]:haha
Organizational Unit Name (eg, section) []:haha
Common Name (e.g. server FQDN or YOUR name) []:test.example.com.cn
Email Address []:11111@qq.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:1111
An optional company name []:haha
步骤3: 生成证书
openssl req -config D:\Apache24\conf\openssl.cnf -x509 -days 365 -key server.key -in server.csr > server.crt
openssl req -config D:\wamp\bin\apache\apache2.4.9\conf\openssl.cnf -x509 -days 365 -key server.key -in server.csr > server.crt
把得到的server.key和server.crt文件拷贝到apache的对应目录 conf/
步骤4: 配置apache
修改httpd-ssl.conf文件
注意在此文件中配置证书和密钥
SSLCertificateFile /apache/conf/server.crt
SSLCertificateKeyFile /apache/conf/server.key
虚拟机设置
NameVirtualHost *:443 (此句根据情况添加,有的版本不需要)
<VirtualHost *:443>
…………
</VirtualHost>
步骤5: 修改httpd.conf文件
1)打开ssl模块
LoadModule ssl_module /opt/taobao/install/httpd/modules/mod_ssl.so
2)引入ssl配置文件
Include conf/extra/httpd-ssl.conf
3)修改httpd-ssl.conf文件中的
DocumentRoot
ServerName
4)如果你配置的虚拟机,注意一下端口的访问接受情况
NameVirtualHost *:80
<VirtualHost *:80>
…………
</VirtualHost>
5)启用和socache相关的所有配置
6)重新启动apache
用https方式访问,查看是否生效(添加例外)
注:如果无法启动报错,请在命令行执行下面的语句:
##检查启动报错的问题:apache2.4是服务名称
#cd apache安装目录/bin
#httpd.exe -w -n "apache2.4" -k start
根据报错信息进行修改
(如果需要CA证书)
1、在生成server.key和server.csr之后
步骤1:使用OPENSSL生成CA私钥
C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl genrsa -out ca.key 1024
多出CA.key文件
步骤2:利用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
步骤3:在bin目录下新建demoCA目录,在demoCA下新建index.txt,newcerts,serial 目录结构如下
demoCA
|--index.txt(文本,内容为空)
|--newcerts(文件夹)
|--serial(文本,内容为 01)
步骤4:准备为网站服务器签署证书
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文件
步骤5:将 server.crt server.key复制到 conf文件夹下
其他步骤见上
- win7(64位)+apache(集成环境) 开启openssl
- win7 64位 eclipse集成python搭建opengl环境
- win7 64位操作系统下配置PHP+MySql+Apache环境
- Win7 64位操作系统下配置PHP+MySql+Apache环境
- Win7 64位操作系统下配置PHP+MySql+Apache环境
- Win7 64位操作系统下配置PHP+MySql+Apache环境
- Win7 64位操作系统下配置PHP+MySql+Apache环境
- 64位Win7系统中配置Apache+Mysql+PHP环境
- php7&Apache 开启openssl
- OpenSSL编译(Win7,64位,VS2010)
- 64位win7,VS2010编译openssl
- WIN7 64位下安装OPENSSL
- WIN7 64位系统 VS2012 安装openssl
- win7安装openssl,编译32位&64位
- win7 64位 php环境开启curl服务Call to undefined function curl_init()
- win7 64位 php环境开启curl服务Call to undefined function curl_init()
- win7 64位 php环境开启curl服务Call to undefined function curl_init
- 64位win7环境eclipse集成svn后出现Failed to load JavaHL Library的解决办法
- YV12转Iplimage
- SPRING DATA JPA 查询关键字
- 第12章 使用结构化命令
- Python中的循环
- 10分钟搞定工作周报
- win7(64位)+apache(集成环境) 开启openssl
- 一篇文章带你全面了解LoRa水表
- Java基础知识
- 在Visual Studio下配置OpenCV的3种方式
- 使用Httpclient向百度翻译提交POST请求 接受返回的JSON字符串 实现翻译功能(3)----BufferedReader与BufferedWriter的使用
- GCD定时器替换NSTimer不准的问题
- PHP搭建自己的MVC框架7 模型层
- Android解决异常: startRecording() called on an uninitialized AudioRecord.
- android studio 安装Intel HAXM为Android 模拟器加速