apache 自签名证书制作方法
证书替换
集团官网自签名证书制作方法,随便找一台linux服务器,只需执行如下两步:
1.首先生成CA的key文件(随便找一台linux):
openssl genrsa -des3 -out hna.key 1024
2.然后生成CA自签名证书(随便找一台linux),里面的cn啥的随便输就行:
openssl req -new -x509 -key hna.key -out hna.crt -days 3650
3、将生成的hna.key和hna.crt拷贝到apache服务器/usr/local/apache2/conf.d目录下。
4、修改apache 的httpd.conf文件,加上证书保存路径
配置httpd.conf文件
DocumentRoot /var/www/html/hna2014
ServerName temp.hnagroup.com
SSLEngine on
SSLCertificateFile /usr/local/apache2/conf.d/hna.crt
(证书保存路径)
SSLCertificateKeyFile /usr/local/apache2/conf.d/hna.key
(证书保存路径)
allow from all
Options -Indexes
AllowOverride All
Deny from all
5、在apache服务器上面安装mod_ssl模块
yum -y install mod_ssl*
6、在apache服务器同时配置/usr/local/apache2/conf.d/ssl.conf文件
SSLCertificateFile /usr/local/apache2/conf.d/hna.crt(证书保存路径)
SSLCertificateKeyFile /usr/local/apache2/conf.d/hna.key(证书保存路径)
7、启httpd
/usr/local/apache2/bin/apachectl restart
参考文档:
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28916011/viewspace-1527873/
,如需转载,请注明出处,否则将追究法律责任。