六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 45|回复: 0

Apache HTTPS配置

[复制链接]

升级  50%

5

主题

5

主题

5

主题

童生

Rank: 1

积分
25
 楼主| 发表于 2013-1-27 05:08:48 | 显示全部楼层 |阅读模式
创建下面3个目录:
C:\Program Files\Apache Group\Apache2\conf\ssl
C:\Program Files\Apache Group\Apache2\conf\ssl.key
C:\Program Files\Apache Group\Apache2\conf\ssl.crt


这里假设apache安装目录是C:\Program Files\Apache Group\Apache2\

下载http://tud.at/programm/openssl.cnf 到 C:\Program Files\Apache Group\Apache2\conf\ssl 目前下

进入命令行,输入下面的命令:
# 注:以下用到的密码都是1234
openssl req -config openssl.cnf -new -out server.csr


  Country Name (2 letter code) []:CN
  State or Province Name (full name) []:Shanghai
  Locality Name (eg, city) []:Shanghai
  Organization Name (eg, company) []:Company name
  Organizational Unit Name (eg, section) []:IT
  Common Name (eg, your websites domain name) []:www.test.com
  Email Address []:webmaster@test.com

  Please enter the following 'extra' attributes to be sent with your certificate request  A challenge password []:1234

openssl rsa -in privkey.pem -out server.key

openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
openssl x509 -in server.crt -out server.der.crt -outform DER

把server.crt移动到C:\Program Files\Apache Group\Apache2\conf\ssl.crt下
把server.key移动到C:\Program Files\Apache Group\Apache2\conf\ssl.key下

  
C:\Program Files\Apache Group\Apache2\apache.exe -D SSL
cd C:\Program Files\Apache Group\Apache2\bin
Apache.exe -k install
Apache.exe -k config -D SSL
Apache.exe -k start
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表