配置apache使用https访问
准备
yum install mod_ssl openssl
生成一个自签名证书
cd /etc/pki/CA
1.生成2048位的加密私钥
openssl genrsa -out server.key 2048
2.生成证书签名请求
openssl req -new -key server.key -out server.csrYou are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:beijing
Locality Name (eg, city) [Default City]:beijing
Organization Name (eg, company) [Default Company Ltd]:test.com
Organizational Unit Name (eg, section) []:test
Common Name (eg, your name or your server's hostname) []:test.com
Email Address []:test@qq.comPlease enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:123456An optional company name []:test
3.生成类型为X509的自签名证书(有效期36500天)
openssl x509 -req -days 36500 -in server.csr -signkey server.key -out server.crt
3.配置Apache服务
vim /etc/httpd/conf.d/ssl.conf
1.修改下面的内容
SSLCertificateFile /etc/pki/CA/server.crt
SSLCertificateKeyFile /etc/pki/CA/server.key
2.重启Apache
/etc/init.d/httpd restart
4.调整虚拟主机
cd /etc/httpd/conf.d
vim test.conf
添加以下内容
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/CA/server.crt
SSLCertificateKeyFile /etc/pki/CA/server.key
<Directory /var/www/html/>
    AllowOverride All
</Directory>
ServerAdmin email@example.com
DocumentRoot /var/www/html/
ServerName www.test.com
</VirtualHost>
5.测试访问
1.因为域名只是一个测试的,所以需要再Windows下绑定hosts,自定绑定
2.访问测试
https://Ip												
											配置apache使用https访问的更多相关文章
- https----------如何在phpstudy环境下配置apache的https访问以及访问http自动跳转成https
		
1.首先在 httpd.conf里面修改几个地方 找到 #LoadModule ssl_module modules/mod_ssl.so 去掉前面的# Include conf/vhosts.con ...
 - Windows下Nginx配置SSL实现Https访问(包含证书生成)
		
Vincent.李 Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...
 - Ubuntu下配置apache开启https
		
一.HTTPS简述随着网络的日常,信息安全越来越重要,传统的网站都是http协议明文传输,而HTTPS协议是由SSL+HTTP协议构建的可进行加密传输.身份认证的网络协议,比http协议安全. 那ht ...
 - windows下配置svn的https访问
		
svn是一个功能强大的代码版本管理系统,可以将服务端安装在linux.unix以及windows下.svn通常采用http方式进行代码提交与下载.由于密码采用明文传输,因此存在泄密的风险.若采用htt ...
 - centos配置apache的https服务
		
因为公司要开发微信小程序,由于小程序比较特殊,需要https服务,所以就研究了下apache的https服务了,大致过程如下: 1.向证书机构申请https证书,会得到证书和私钥 2.安装apache ...
 - linux下配置apache多站点访问-小案例
		
一级域名(baidu.com)也叫作顶级域名,注册一级域名是需要付费的. 而二级域名(image.baidu.com)是一级域名的延伸,所以只要购买了一级域名,二级域名是可以任意配置的. 其实(www ...
 - 阿里云服务器在控制台配置网页强制https访问
		
最近接触到一个新的网站,网站的访问方式,是http, 因此在浏览器打开的时候老是显示不安全.因此要配置https访问. 首先,先说明服务器是在阿里云的,域名也是阿里云的. 方法一 1 首先在阿里云的c ...
 - 安装配置ingress-nginx支持https访问
		
说明:  1.k8s版本:v1.23:  2.内网测试环境1台master,2台node节点,使用 DaemonSet+HostNetwork+nodeSelector 方式部署 ingress- ...
 - center os7.2 apache+php+mysql环境配置并设置https访问
		
本人阿里云购买的center os7.2系统,小程序只支持https,因此需要配置https 安装apache yum -y install httpd systemctl start httpd a ...
 
随机推荐
- 【MOOC EXP】Linux内核分析实验二报告
			
程涵 原创博客 <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 [操作系统是如何工作的] 教学内 ...
 - Python爬虫爬中文却显示Unicode,怎样显示中文--问题解答
			
首先爬取古诗网站时,显示 原因是因为输出为列表[] 如果写一个循环,输出其中每个元素就为中文了...
 - Objective-C 语言特点/特性
			
Objective-C中 1.所有的类都必须继承自NSObject. 2.所有对象都是指针的形式. 3.用self代替this. 4.使用id代替void*. 5.使用nil表示NULL, 6.只支持 ...
 - Android 7.0+相机、相册、裁剪适配问题
			
Android 7.0+相机.相册.裁剪适配问题 在manifest中: <provider android:name="android.support.v4.content.File ...
 - MySQL 字符串截取函数
			
MySQL 字符串截取函数:left(), right(), substring(), substring_index().还有 mid(), substr().其中,mid(), substr() ...
 - send和sendmsg性能测试
			
1,摘要:测试send和sendmsg的性能,影响这两个函数性能主要有发送的字节大小,增加循环次数,从100到10000000(千万)2,基本信息cat /proc/cpuinfo查看CPU信息,如下 ...
 - Spring之c3p0连接池配置和使用
			
1.导入包:c3p0和mchange包 2.代码实现方式: package helloworld.pools; import com.mchange.v2.c3p0.ComboPooledDataSo ...
 - 一本通1623Sherlock and His Girlfriend
			
1623:Sherlock and His Girlfriend 时间限制: 1000 ms 内存限制: 524288 KB [题目描述] 原题来自:Codeforces Round ...
 - Java基础整理之字节、数组、字符串、面向对象
			
一.字节(8个)8bit = 1B或1byte1024B = 1Kb 二.强制类型转换顺序及其大小顺序遵循向上转换的规则byte,short,char -> int -> long -&g ...
 - Python学习--------------Atm+购物车系统
			
一.程序需求 模拟实现一个ATM + 购物商城程序: 1.额度 15000或自定义 2.实现购物商城,买东西加入 购物车,调用信用卡接口结账 3.可以提现,手续费5% 4.每月22号出账单,每月10号 ...