linux apache https配置
来源:互联网 发布:制作身份证软件下载 编辑:程序博客网 时间:2024/05/22 06:22
apache开启mod_ssl扩展
apache的配置文件apache2/conf/httpd.conf,去除下面的注释#。
#LoadModule ssl_module modules/mod_ssl.so
如果apache里面没有mod_ssl.so这个扩展,利用apxs动态编译该扩展或者重新编译apache,重新编译参数如下:
./configure --enable-so --enable-mods-shared=most
加载conf/extra/httpd-ssl.conf配置文件。去除下面的注释#。
#Include conf/extra/httpd-ssl.conf
配置httpd-ssl.conf文件,将配置https访问项目的目录和域名配置到该文件中。
<VirtualHost _default_:443>DocumentRoot "/www"ServerName www.domain.com:443ServerAdmin abc@abc.com...
生成证书
保证你的系统中已经安装了openssl。
第一步生成key
openssl genrsa -des3 -out server.key 1024
第二步生成csr
openssl req -newkey rsa:2048 -keyout server.key -out server.csr
第三部生成crt
openssl req -x509 -days 365 -key server.key -in server.csr > server.crt
现在生成了三个文件:server.key,server.csr,server.crt。
打开conf/extra/httpd-ssl.conf文件,然后将下面位置配置为生成的key和crt文件,文件路径写自己的。
...SSLCertificateFile "/tmp/server.crt"...SSLCertificateKeyFile "/tmp/server.key"...
然后重启apache,打开自己的域名查看。
可以看到,https服务已经配置成功。
这里https证书是我们自己生成的,没有认证,所以有红叉叉的提示。
startssl免费认证证书
证书生成步骤官网有详细说明。
使用startssl证书之后,将证书文件下载下来,传输到服务器,conf/extra/httpd-ssl.conf配置如下:
相比自己生成的证书和key多了一个crt文件。
...SSLCertificateFile "/ptah/2_www.domain.com.crt"...SSLCertificateKeyFile "/ptah/www.domain.com.key"...SSLCACertificateFile "/ptah/1_root_bundle.crt"...
然后重启apache,可以看到
0 0
- Linux apache配置https
- linux apache https配置
- [转]Linux Apache Https 配置
- 在Linux上配置Apache HTTPS服务
- linux下apache https 虚拟主机配置
- linux 下部署 openssl+apache 配置https
- Apache配置https全过程
- Apache配置https全过程
- Apache https 配置指南
- Apache https 配置指南
- Windows Apache HTTPS配置
- Windows Apache HTTPS配置
- FreeBSD Apache HTTPS配置
- apache 配置https
- apache配置https连接
- apache配置https协议
- apache https配置
- apache Tomcat配置https
- js拼接html字符串注意事项
- leetcode:字符串之Length of Last Word
- BMFont制作字体
- AccessbilityService实现第三方软件的点击
- Android内存泄露——全解析和处理办法
- linux apache https配置
- regexp_like字符串中的指定字符串或者字符,区分逗号
- [BZOJ4422][Cerc2015]Cow Confinement(差分+扫描线+线段树)
- AngularJS ui-router (嵌套路由)
- PhoneStateListener 引起的内存泄露
- SQLite CRUD
- 如何在Mac OS X上安装 Ruby运行环境
- javafxpackager命令参数
- Luban(鲁班)——可能是最接近微信朋友圈的图片压缩算法