Record the process of deploying SSL certificates between Qiniu and Apache (WordPress)

reason

I saw news before: Let's Encrypt supports universal domain name ssl certificate on February 27 However, since the validity of Let's Encrypt certificate is 90 days, I searched for other free pan domain name certificates. The effort pays off. I really found a free alpha wild card application station of Mao Zi on the dog, so I got a *. azimiao.com.

 Universal Domain Name Certificate

Although the validity period of the certificate is written as one year, it is uncertain when it will be revoked. It is still OK to play with it. Since the Alibaba Cloud virtual host used by Zimiao doesn't support ssl, we tried it on Qiniu and local Apache.

Seven Bull deployment ssl certificate

The deployment of SSL certificates by Qiniu is very simple and user-friendly.

1. Add a certificate

Enter the 7N management console ->Upload your own certificate ->Copy the certificate content and private key ->Confirm to upload. Then you can see the certificate in My Certificate.
 Seven Bull Addition Certificate

2. Assign a certificate to the domain name

Select the corresponding certificate modification in Convergence CDN ->Domain Name Management ->Configuration ->HTTPS Configuration.
 Seven Cattle Distribution Certificate

3. Access test

 Access test The deployment of SSL certificate is completed. However, it is worth mentioning that Qiniu's HTTPS is not included in the free traffic, as is AliCloud's cdn. Please pay attention to the bill.

Apache deploy ssl certificate

To facilitate debugging, I simply resolved localhost.azimiao.com to 127.0.0.1.

1. Modify the httpd.conf file

  • Listen to port 443
     Listen 443
  • Find the place where the ssl module is loaded and remove the previous #.
     LoadModule ssl_module modules/mod_ssl.so
  • The master station has other functions and does not need ssl
     SSLEngine off
  • Load the virtual host configuration and remove the previous #.
     Include conf/extra/httpd-vhosts.conf

2. Add virtual host

Add a virtual host supporting ssl in httpd-vhosts.conf

 <VirtualHost *:443> DocumentRoot "D:/Data/Apache24/htdocs/wp" ServerName localhost.azimiao.com:443 SSLEngine on #Server certificate SSLCertificateFile "D:/Data/Apache24/conf/certificate/star.azimiao.com.crt" #Private key SSLCertificateKeyFile "D:/Data/Apache24/conf/certificate/star.azimiao.com.key" #Certificate chain EV #SSLCertificateChainFile "*:/chain.cer" ErrorLog "D:/Data/Apache24/error/errazimiao.log" TransferLog "D:/Data/Apache24/error/assessazimiao.log" </VirtualHost>

3. Start Apache

 Start Apache

4. Operation to be performed by WordPress

4.1 Modifying the site address

 Modify site address

4.2 Modify http link

If a page introduces https and http mixed resources at the same time, the small green lock will not be displayed. The solution is to modify the link of the introduced resources:

  • Change http to https.
  • Replace "http (s)//" with "//" to make the browser automatically select.
  • Article: Since resources in multiple articles are involved, you need to write an SQL statement to replace it according to the actual situation.
 UPDATE wp_posts SET post_content = REPLACE ( post_content, ' http://picture.azimiao.com/ ', '//picture.azimiao.com/' );
  • Resources: mainly refer to http resources introduced in the theme, such as third-party http content referenced in the style sheet.
  • Others: search and modify according to the prompt information in chrome debugging.

5. Access test

 Access test

Apache (WordPress) successfully deployed ssl certificate.

Postscript

Aliwan's virtual host has been slow to support PHP 7.0 and https. When asked about these customer services, Aliwan always recommends buying ECS. The record number is in Alibaba Cloud, so it is a bit troublesome to transfer it to other places. The virtual host expires in February 2019. Let's think about it then.

After the end of the year, the price of Alibaba Cloud domain name renewal has increased. com has become 69 soft, cn has become 39 soft, and other companies are still 60 soft/35 soft. Although the discount code can be converted to 60/35, I always feel uncomfortable. When I have time, I will transfer all the domain names.

Whether to use WP Editor Partner of MD plug-in? Who can tell Markdown how to add target="_blank" and rel="nofollow" attributes to the link?

Zimiao haunting blog (azimiao. com) All rights reserved. Please note the link when reprinting: https://www.azimiao.com/3442.html
Welcome to the Zimiao haunting blog exchange group: three hundred and thirteen million seven hundred and thirty-two thousand

Comment

*

*

Comment area

  1. c0sMx 02-21 12:39 reply

    In recent years, there are also virtual hosts that do not support https.

  2. AliCloud virtual hosts are also helpless.

  3. xema 02-22 14:46 reply

    Only then did I realize that I should get an https for Qiniu

    • hare 02-22 16:58 reply

      Qiniu requests domain name filing

  4. AliCloud, hey

  5. 356b7b8b11459e10a71b7041066bafae

  6. Qinghe Jun 02-25 15:04 reply

    I want 89 for one year, but I still can't find the discount code..

  7. 4Rou 03-01 18:47 reply

    AliCloud student ECS only costs 10 yuan a month 😀

    • hare 03-01 19:17 reply

      Now it costs dozens of yuan to buy a certified student account.

  8. Bobbi 03-22 13:03 reply

    It seems complicated to open https

  9. WeiCN 11-18 16:06 reply

    Target="_blank" It seems to depend on the support of the parser, but some do not