Apache 部署https证书

来源:互联网 发布:网络配音员招聘 编辑:程序博客网 时间:2024/06/05 08:08
1、打开 apache 安装目录下 conf 目录中的 httpd.conf 文件,找到
#LoadModule ssl_module modules/mod_ssl.so
(如果找不到请确认是否编译过 openssl 插件)
#Include conf/extra/httpd_ssl.conf
删除行首的配置语句注释符号“#”
保存退出。
2、打开 apache 安装目录下 conf/extra 目录中的 httpd-ssl.conf 文件
(注释:yum 安装配置目录:conf.d/ssl.conf
ubuntu/apache2 安装目录:conf/sites-enabled/*.conf )
在配置文件中查找以下配置语句:
a. 添加 SSL 协议支持语句,关闭不安全的协议和加密套件
SSLProtocol all -SSLv2 -SSLv3
b.修改加密套件如下
SSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
c.将服务器证书公钥配置到该路径下(在 conf 目录下创建 ssl 目录,将 for Apache 里面的三
个证书文件拷贝到 ssl 目录下)
SSLCertificateFile conf/ssl/test.wosign.com.crt (证书公钥)
d.将服务器证书私钥配置到该路径下
SSLCertificateKeyFile conf/ssl/test.wosign.com.key (证书私钥)
e.将服务器证书链配置到该路径下
#SSLCertificateChainFile conf/ssl/1_root_bundle.crt(证书链)删除行首的“#”号注
释符
保存退出,并重启 Apache。重启方式:
3、进入 Apache 安装目录下的 bin 目录,运行如下命令

./apachectl -k stop

启动后如果报错:AH00526: Syntax error on line 74 of /u01/apache/conf/extra/httpd-ssl.conf:
SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).

请修改SSLSessionCache        "shmcb:/u01/apache/logs/ssl_scache(512000)"为:SSLSessionCache         nonenotnull

./apachectl -k start
0 0
原创粉丝点击