首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >apache https配置详细步骤讲解

apache https配置详细步骤讲解

作者头像
习惯说一说
修改2019-07-17 09:51:50
7.3K1
修改2019-07-17 09:51:50
举报

主要讲述在windows下apache配置SSL以实现http转换为httpsSSL: SSl是为Http传输提供安全的协议,通过证书认证来确保客户端和网站服务器之间的数据是安全。也就是说在SSL下http传输是安全的,我们成为 https.

配置过程如下:

步骤一:安装apache,使其支持SSL,并安装php

1.安装配有SSL模块的apache,apache_2.2.8-win32-x86-openssl-0.9.8g

2.配置apache以支持SSL:打开apache的配置文件conf/httpd.conf

1)LoadModule ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

去掉两行前面的#

2)注意修改httpd-ssl.conf 文件里的两个字段:

SSLCertificateFile "C:/Apache2.2/conf/server.crt"

SSLCertificateKeyFile "C:/Apache2.2/conf/server.key"

3.安装php,整合apache和Php(略)

为下面你所生成的证书和密钥地址。

步骤二:为网站服务器生成证书及私钥文件

1. 生成服务器的私钥

进入命令行:

D:\local\apache2\bin\openssl genrsa -out server.key 1024

在当前目录下生成了一个server.key生成签署申请

2. 生成签署申请

D:\local\apache2\bin>openssl req -new –out server.csr -key server.key -config ..\conf\openssl.cnf

此时生成签署文件server.csr.

步骤三:通过CA为网站服务器签署证书

1.生成CA私钥

D:\local\apache2\bin\openssl genrsa -out ca.key 1024

多出ca.key文件

2.利用CA的私钥产生CA的自签署证书

D:\local\apache2\bin\openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf

此时需要输入一些信息,注意Common Name为服务器域名,如果在本机,为本机IP。

3.CA为网站服务器签署证书

D:\local\apache2\bin\openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf

但,此时会报错:

于是在在当前目录创建demoCA,里面创建以下文件,index.txt,serial:serial内容为01,其他为空,以及文件夹 newcert.再执行一遍,即可生成server.crt文件

步骤四:然后将 server.crt,server.key复制到apache的conf文件夹下,重启apache

步骤五:配置windows.

打开C:\WINDOWS\system32\drivers\etc下的etc文件:

修改为:

127.0.0.1 next0-testing.acgchina.8866.org

127.0.0.1 pp-testing.acgchina.8866.org

127.0.0.1 tlink-testing.acgchina.8866.org

步骤六:

在apache下写入iframe网页,并将testlink,projectpier也放入。

<iframe src="https://pp-testing.acgchina.8866.org/projectpier/index.php" width="300" height="300"></iframe>

<iframe src="https://tlink-testing.acgchina.8866.org/testlink/index.php" width="300" height="300"></iframe>

于是访问https://next0-testing.acgchina.8866.org能看到正确的显示。

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
SSL 证书
腾讯云 SSL 证书(SSL Certificates)为您提供 SSL 证书的申请、管理、部署等服务,为您提供一站式 HTTPS 解决方案。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档