nginx安装GODADDY证书

[root@longquan opt]# openssl genrsa -out domain.com.key 2048   //创建私钥


Generating RSA private key, 2048 bit long modulus


[root@longquan opt]# openssl req -new -key domain.com.key -out domain.com.csr   //创建CSR (Certificate signing request),需要指定刚才生成的私钥


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) []:SH


Locality Name (eg, city) [Default City]:SH


Organization Name (eg, company) [Default Company Ltd]:厦门某某某有限公司


Organizational Unit Name (eg, section) []:


Common Name (eg, your name or your server's hostname) []:domain.com


Email Address []:




Please enter the following 'extra' attributes


to be sent with your certificate request


A challenge password []:


An optional company name []:


[root@longquan opt]# ls


domain.com.csr  domain.com.key  RAP  rap_release_v0.11.3_20150727.war  rh  ROOT


[root@longquan opt]# cat domain.com.csr   //把这一串粘帖到GODADDY那边


-----BEGIN CERTIFICATE REQUEST-----


...

...

...

...

...


-----END CERTIFICATE REQUEST-----




验证域名所有权限,2个方法


1、验证DNS


2、放到根目录上(用这个方法需要在上传后自己浏览器访问一下)




大概10分钟内就可以下载证书




[root@longquan opt]# mkdir -p /usr/local/nginx/conf/ssl/


[root@longquan opt]# cp domain.com.key /usr/local/nginx/conf/ssl/


[root@longquan opt]# cd /usr/local/nginx/conf/ssl/longquan/


[root@longquan opt]# rz    //上传从GODADDY下载下来的2个crt文件


rz waiting to receive.


 zmodem trl+C 100%       1 KB    1 KB/s 00:00:01       0 Errors.


  100%       4 KB    4 KB/s 00:00:01       0 Errors




[root@longquan opt]# ll


总用量 16


-rw-r--r-- 1 root root 1838 10月 28 03:00 4f66c3613*.crt


-rw-r--r-- 1 root root 4795 10月 28 03:00 gd_bundle-g2-g1.crt


-rw-r--r-- 1 root root 1675 10月 28 19:25 domain.com.key


Fix Intermediate Certificate Chain   


[root@longquan opt]# cat gd_bundle-g2-g1.crt >> 4f66c3613*.crt 


[root@longquan opt]# cp 4f66c3613*.crt domain.com.crt   //取个我们容易识别的CRT名称



在虚拟主机配置文件上的server段里面添加


        ssl                  on;


        ssl_certificate      ssl/domain.com.crt;


        ssl_certificate_key   ssl/domain.com.key;


        ssl_session_timeout  5m;


        ssl_protocols  SSLv3 TLSv1;


        ssl_ciphers HIGH:!aNULL:!MD5:!EXPORT56:!EXP;


        ssl_prefer_server_ciphers   on;




[root@longquan opt]# nginx -t


nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok


nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful


[root@longquan opt]# nginx -s reload




注意:先在测试机上测试再上到正式线上



转载于:https://my.oschina.net/longquan/blog/657180

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值