配置HTTPS服务器之Apache

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/zzjstudent/article/details/77164874
配置https服务器(apache)
1. 确认open_ssl模块已经安装,检查apache已经加载/usr/lib/apache2/modules/mod_sso.so
2. 生成证书和密钥
a) 生成密钥openssl genrsa 1024 > server.key
b) 生成csr文件openssl req -new -key server.key > server.csr
c) 通过a,b的密钥和csr生成证书(server.crt) 
openssl req -x509 -days 365 -key server.key -in server.csr > server.crt
 
d) 将server.key和server.crt拷贝到
SSLCertificateFile /apache/conf/server.crt
SSLCertificateKeyFile /apache/conf/server.key
3. 配置apache
a) 修改httpd-ssl.conf(ubuntu是/etc/apache2/site-available/default-ssl)配置节:
i. 配置ServerName 为gn.huaqin.com的虚拟主机,端口443
ii. SSLCertificateFile /apache/conf/server.crt
iii. SSLCertificateKeyFile /apache/conf/server.key
b) 修改httpd.conf(ubuntu无需配置)配置节:
i. 加载ssl模块
LoadModule ssl_module /opt/taobao/install/httpd/modules/mod_ssl.so
ii. 引入ssl配置
Include “/apache/conf/httpd-ssl.conf”
iii. 配置ServerName 为gn.huaqin.com的虚拟主机,端口443
c) 重启apache服务
展开阅读全文

linux apache 配置https

09-25

大家好,请教个问题。我在linux 下的apache 中配置https,将公司的域名访问方式从http改为https ,但是配置完后 apache 启动日志没报错。rn1.日志文件如下:rn文件名:error_logrnrn文件内容:rn[Mon Sep 25 10:59:03 2017] [notice] caught SIGTERM, shutting downrn[Mon Sep 25 10:59:25 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)rn[Mon Sep 25 10:59:26 2017] [notice] Digest: generating secret for digest authentication ...rn[Mon Sep 25 10:59:26 2017] [notice] Digest: donern[Mon Sep 25 10:59:26 2017] [notice] Apache/2.2.15 (Unix) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips configured -- resuming normal operationsrnrn2.apache 里面的ssl.conf 文件配置如下:rnrn ServerSignature Onrn SSLEngine onrn SSLCertificateKeyFile /etc/httpd/conf.d/ssl.key/www.domain.com.keyrn SSLCertificateFile /etc/httpd/conf.d/ssl.crt/www.domain.com.crtrn #DocumentRoot "/etc/httpd/htdocs"rn ServerName www.domain.comrn ServerAdmin compname@compname-soft.comrn ErrorLog /etc/httpd/logs/wwwerror_ssl.logrn TransferLog /etc/httpd/logs/wwwaccess_ssl.logrn CustomLog /etc/httpd/logs/www.access.log commonrn rn ProxyPass / http://192.168.2.19:8080/rn ProxyPassReverse / http://192.168.2.19:8080/rn rn AllowOverride Nonern Order Deny,Allowrn Allow from allrn rnrnrn[color=#FF0000]其中 ssl的证书www.domain.com.key, www.domain.com.crt 我是在腾讯云上面申请的。[/color][size=14px][/size]rnrn3.apahce 版本:2.2.15rnrn4.linux版本:rn2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 rnRed Hat Enterprise Linux Server release 6.3 (Santiago) 论坛

没有更多推荐了,返回首页