{"id":388,"date":"2019-03-17T21:55:16","date_gmt":"2019-03-18T04:55:16","guid":{"rendered":"http:\/\/35.243.195.209\/?p=388"},"modified":"2019-12-22T21:01:06","modified_gmt":"2019-12-23T05:01:06","slug":"install-ssl-certificate-and-change-to-https","status":"publish","type":"post","link":"https:\/\/nanzhou.cc\/index.php\/2019\/03\/17\/install-ssl-certificate-and-change-to-https\/","title":{"rendered":"Install SSL Certificate and Change To HTTPS"},"content":{"rendered":"<h2>Summary<\/h2>\n<p>In this post, I will introduce how to install the SSL certificate for WordPress. <\/p>\n<h2>Conclusion<\/h2>\n<p>I did some research and tried different methods. Now I will provide the simplest ways. <\/p>\n<ol>\n<li>Apply for an SSL certificate;<\/li>\n<li>Download the certificate and sent it to the server;<\/li>\n<li>Do the following command: <code>sudo yum install mod_ssl<\/code>;<\/li>\n<li>Add a file httpd-ssl.conf to <code>\/etc\/httpd\/conf.d\/<\/code>, which will be loaded by httpd.conf in <code> \/etc\/httpd\/conf\/<\/code>;\n<pre><code class=\"language-bash\">&lt;VirtualHost 0.0.0.0:443&gt;\nDocumentRoot &quot;\/var\/www\/html&quot;\nServerName www.domain.com\nSSLEngine on\nSSLCertificateFile \/path\/to\/certificate\/2_www.domain.com_cert.crt\nSSLCertificateKeyFile  \/path\/to\/certificate\/3_www.domain.com.key\nSSLCertificateChainFile \/path\/to\/certificate\/1_root_bundle.crt\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n<\/li>\n<li>Restart Apache service <code>apachectl stop<\/code> and <code>apachectl start<\/code>;<\/li>\n<\/ol>\n<h2>Details<\/h2>\n<h3>Apply for an SSL certificate<\/h3>\n<p>I applied a free personal SSL certificate in the same site (<a href=\"https:\/\/intl.cloud.tencent.com\">Tencent Cloud<\/a>) where I bought my domain. <\/p>\n<h3>mod_ssl<\/h3>\n<p>I came across some bugs after adding the SSL configuration file.<\/p>\n<pre><code class=\"language-bash\">[root@10-255-0-79 ~]# apachectl configtest\nAH00526: Syntax error on line 5 of \/etc\/httpd\/conf.d\/httpd-ssl.conf:\nInvalid command &#039;SSLEngine&#039;, perhaps misspelled or defined by a module not included in the server configuration<\/code><\/pre>\n<p>I found that in my Apache installation, mod_ssl.so was outright missing. It turns out it is separate from the base installation and was under the package mod_ssl in the yum package manager. Simply do <code>sudo yum install mod_ssl<\/code> solve this problem. <\/p>\n<h2>Reference<\/h2>\n<p><a href=\"https:\/\/cloud.tencent.com\/document\/product\/400\/4143\">Tencent Cloud Product Doc<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary In this post, I will introduce how to install the SSL certificate for WordPress. Conclusion I did some research and tried different methods. Now I will provide the simplest ways. Apply for an SSL certificate; Download the certificate and sent it to the server; Do the following command: sudo yum install mod_ssl; Add a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,22],"tags":[],"class_list":["post-388","post","type-post","status-publish","format-standard","hentry","category-linux","category-operation-systems"],"_links":{"self":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts\/388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/comments?post=388"}],"version-history":[{"count":4,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":638,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts\/388\/revisions\/638"}],"wp:attachment":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/media?parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/categories?post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/tags?post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}