apache 配置https(转)
主要讲述在windows下apache配置SSL以实现http转换为https
SSL: 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能看到正确的显示。
apache 配置https(转)的更多相关文章
- Apache配置HTTPS功能
apache配置https 一.yum 安装openssl和openssl-devel,httpd-devel 二.生成证书(也可以从公司的证书颁发机构获取): #建立服务器密钥 openssl ge ...
- Windows上为Apache配置HTTPS
Windows上为Apache配置HTTPS 转 https://www.cnblogs.com/tianzijiaozi/p/7582671.html 1. 安装OpenSSL: Windo ...
- Linux下Apache配置HTTPS功能
Apache配置HTTPS功能 转 https://www.cnblogs.com/liaojiafa/p/6028816.html 一.yum 安装openssl和openssl-devel,ht ...
- Apache配置https
Apache配置https 之前一直用的是Tomcat,今天突然接到任务要给Apache配置https证书,因为小程序要用.下面把过程列出来以备后续查看. 1.首先你得有ssl证书,没有的可以去购买, ...
- 在linux下的apache配置https协议,开启ssl连接
环境:linux 配置https协议,需要2大步骤: 一.生成服务器证书 1.安装openssl软件 yum install -y openssl mod_ssl 2.生成服务器私匙,生成server ...
- lamp之apache配置https访问
配置apache 使用https 注:怕其他人由于路径的原因出问题,首先声明一下,本人apache的安装目录为 : /usr/local/httpd2.4.25,如果不是,请参考进行配置 注: 对于如 ...
- Linux Apache配置https访问
配置https访问 该环境是rh254课程配套的一个环境,不过配置方法步骤相同. 要求: 使用虚拟主机技术部署两个网站: 网站1: 绑定域名 www0.example.com 目录在 /srv/www ...
- Apache 配置Https 转发Tomcat Http
Apache 相对于nginx的配置对比起来相当复杂啦,朋友之前的系统使用的是Apache需要增加一个虚拟主机,主要配置从Apache转发Tomcat. 首先需要拆解下步骤: Apache 支持Htt ...
- apache配置https协议
安装openssl有两种方式,第一种直接下载安装包,装上就可运行:第二种可以自己下载源码,自己编译.下面对两种方式均进行详细描述. 一.下载和安装openss 方法一:直接使用openssl安装包 W ...
随机推荐
- firebug js版
1.有些时候如 ie6 7 8 你觉得F12 不好用的话 你可以直接 把这两个js 引用到html 里面 <script src="https://getfirebug.com/fi ...
- Ubuntu安装google chrome过程
Ubuntu安装google chrome过程: # wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd6 ...
- 【转】POJ题目分类
初级:基本算法:枚举:1753 2965贪心:1328 2109 2586构造:3295模拟:1068 2632 1573 2993 2996 图:最短路径:1860 3259 1062 2253 1 ...
- iphone立体矢量图标_学习教程
- jquery图片轮播代码
自己写的轮播代码 来张样式效果图 先贴HTML样式 <body> <div id = "wrap"> <div id="lunbo-img& ...
- Js点餐加减数量
<button class="add-on" onclick="chgNum(1,'del')" ><i class="icon-m ...
- rename 后缀
for file in $(find . -name "*.del" -type f);do mv "$file" "${file%.del}&quo ...
- 【java】基于Tomcat的WebSocket转帖 + 自己理解
网址:http://redstarofsleep.iteye.com/blog/1488639 原帖时间是2012-5-8,自己书写时间是2013年6月21日10:39:06 Java代码 packa ...
- yo angualr-fullstatck 项目打包部署
yoeman使用grunt进行打包部署,直接运行grunt命令即可,期间会对代码进行检查,如果存在不规范的地方jshint会指定出来. grunt会对静态资源进行打包而且对资源文件名进行了MD5作为版 ...
- Black Box
http://poj.org/problem?id=1442 #include<cstdio> #include<algorithm> #include<queue> ...