1 openssl生成SSL证书(自行百度)
2 腾讯云,阿里云,百度云等等都有提供免费的SSL证书
2、证书安装
编辑Apache根目录下 conf/httpd.conf 文件,找到
#LoadModule ssl_module modules/mod_ssl.so
#Include conf/extra/httpd-ssl.conf
#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
去掉前面的#号注释;
编辑Apache跟目录下 conf/extra/httpd-ssl.conf 文件,修改如下内容:
<VirtualHost *:443>
DocumentRoot "/var/www/html"
ServerName www.webjlw.com:443
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
SSLEngine on
SSLCertificateFile /usr/local/apache/conf/www.webjlw.com_public.crt
SSLCertificateKeyFile /usr/local/apache/conf/www.webjlw.com.key
SSLCertificateChainFile /usr/local/apache/conf/www.webjlw.com_chain.crt
</VirtualHost>
配置完成后,重新启动 Apache 就可以使用https://www.webjlw.com来访问了。
配置文件参数 说明
SSLEngine on 启用SSL功能
SSLCertificateFile 证书文件
SSLCertificateKeyFile 私钥文件
SSLCertificateChainFile 证书链文件
转载请注明出处。