Apache开启https
2016-11-28 18:05
429 查看
apache 要支持https 必须要有mod_ssl软件
[root@bird www]# yum install mod_ssl
[root@www ~]# /etc/init.d/httpd restart
修改防火墙添加443
Centos 6.x 已经提供了预设的ssl机制所需私钥与凭证文件
* /etc/httpd/conf.d/ssl.conf mod_ssl提供的 Apache 设定文件;
* /etc/pki/tls/private/localhost.key 系統私钥文件,可以用來制作凭证的!
* /etc/pki/tls/certs/localhost.crt 就是加密过的凭证文件!(signed certificate)
添加了https 同一个页面http https都可访问 其实没什么意义 要把https和http的页面分离开
可以采用apache的虚拟机机制进行分离
[root@www ~]# mkdir /var/www/https
[root@www ~]# echo "This is https' home" > /var/www/https/index.html
修改 ssl.conf 的內容
[root@www ~]# vim /etc/httpd/conf.d/ssl.conf
Listen 443 <==预设的监听端口!不建议修改!
<VirtualHost _default_:443> <==就是虚拟主机的设定!
DocumentRoot "/var/www/https" <==大概84行,拿掉注释更改目录名称
ServerName *:443 <==拿掉注释,並将主机名称设定为 *
SSLEngine on <==支持 SSL 的意思!
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/vbird.crt
SSLCertificateKeyFile /etc/pki/tls/certs/vbird.key
</VirtualHost>
[root@www ~]# /etc/init.d/httpd restart
[root@bird www]# yum install mod_ssl
[root@www ~]# /etc/init.d/httpd restart
修改防火墙添加443
Centos 6.x 已经提供了预设的ssl机制所需私钥与凭证文件
* /etc/httpd/conf.d/ssl.conf mod_ssl提供的 Apache 设定文件;
* /etc/pki/tls/private/localhost.key 系統私钥文件,可以用來制作凭证的!
* /etc/pki/tls/certs/localhost.crt 就是加密过的凭证文件!(signed certificate)
添加了https 同一个页面http https都可访问 其实没什么意义 要把https和http的页面分离开
可以采用apache的虚拟机机制进行分离
[root@www ~]# mkdir /var/www/https
[root@www ~]# echo "This is https' home" > /var/www/https/index.html
修改 ssl.conf 的內容
[root@www ~]# vim /etc/httpd/conf.d/ssl.conf
Listen 443 <==预设的监听端口!不建议修改!
<VirtualHost _default_:443> <==就是虚拟主机的设定!
DocumentRoot "/var/www/https" <==大概84行,拿掉注释更改目录名称
ServerName *:443 <==拿掉注释,並将主机名称设定为 *
SSLEngine on <==支持 SSL 的意思!
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/vbird.crt
SSLCertificateKeyFile /etc/pki/tls/certs/vbird.key
</VirtualHost>
[root@www ~]# /etc/init.d/httpd restart
相关文章推荐
- 在linux下的apache配置https协议,开启ssl连接
- Apache和Nginx开启Https
- apache开启https
- 腾讯云CentOS Apache开启HTTPS
- 在linux下的apache配置https协议,开启ssl连接
- Apache 开启 Https
- Linux+Nginx/Apache/Tomcat新增SSL证书,开启https访问教程
- apache下开启ssl访问,即https
- apache开启https
- wdcp 下apache模式开启https访问,支持多站点
- apache和nginx开启https
- apache开启https
- apache下开启ssl访问,即https
- Apache 开启Https双向认证
- wdcp 下apache模式开启https访问,支持多站点
- apache开启https
- apache开启https
- Mac中开启Apache的Https功能
- apache下开启ssl访问,即开启https访问(phpStudy)
- Mac OS X EI Captitan 中Apache开启SSL (HTTPS)