magento SSL 证书安装

1,GODADDY 购买 SSL

Thank you for reading this post, don't forget to subscribe!

2, 使用openssl手动创建证书

yum install openssl

3、生成服务器私钥

cd /etc/pki/tls
openssl genrsa -out server.key 2048

server.key是私钥。

4.用私钥server.key文件生成证书请求文件csr

openssl req -new -key server.key -out server.csr

server.csr是证书请求文件。

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN  // 国家代码
State or Province Name (full name) []:Shanghai  // 省
Locality Name (eg, city) [Default City]:Shanghai  // 市
Organization Name (eg, company) [Default Company Ltd]:Teddysun // 组织或公司名(随便填)
Organizational Unit Name (eg, section) []:  // 部门,可不填
Common Name (eg, your name or your server's hostname) []:teddysun.com // *则是通配符域名,一般证书发行会自带 www 子域名
Email Address []:admin@teddysun.com  // 邮箱地址(一定要有个域名邮箱,用以验证域名所有权)

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:  // 不填
An optional company name []:  // 不填

5,生成数字签名crt文件(证书文件)

在 /etc/pki/tls 这个文件夹中 找到刚才生成的 server.crt 请求证书文件,然后用记事本打开,把里面的内容 拷贝到 GODADDY SSL 里,用来生成2个CRT 证书文件。

等待一阵后 GODADDY 就可以下载2个CRT 证书文件了,

我们肯定需要先将购买的GODADDY SSL证书放到站点目录下。具体放到哪里随便我们,但我们要自己知道放到哪里。这里习惯和配置文件差不多的位置,方便配置的时候查看,比如我在"/www/server/apache/"目录下创建一个SSL目录,然后将SSL证书2个文件丢进去。

6,修改网站Apache配置文件设置SSL证书

/www/server/apache/conf/extra/httpd-ssl.conf

修改这个文件里的

Apache V2.4.8 以下版本
指令 输入的路径
SSLCertificateFile 证书文件路径
SSLCertificateKeyFile 密钥文件路径
SSLCertificateChainFile 中级证书捆绑包路径保存您的配置文件并重新启动 Apache。

保存您的配置文件并重新启动 Apache。

二,然后需要配置MAGENTO 里的 SSL

 

在Secure这个地方换成https://www…….。上面的Unsecure不需要修改。下面有两个选择yes或者no的选项,前台启用SSL就选择yes,后台要启用SSL也选上yes就好了。但是建议先试下前台是否正确,然后再开启后台。免得有错误,后台进不去了。

这样来到前台,看下我们的magento登陆注册页,用户我的账户页还有结账页是不是自动就变成https://www….安全访问了。

 

 

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注