{"id":309,"date":"2020-01-08T22:10:17","date_gmt":"2020-01-09T03:10:17","guid":{"rendered":"http:\/\/www.reginedeguzman.com\/blog\/?p=309"},"modified":"2020-05-29T22:59:07","modified_gmt":"2020-05-30T02:59:07","slug":"setting-up-wordpress-with-godaddy-certificates","status":"publish","type":"post","link":"http:\/\/www.reginedeguzman.com\/blog\/setting-up-wordpress-with-godaddy-certificates\/","title":{"rendered":"Setting up WordPress with GoDaddy certificates"},"content":{"rendered":"<style type=\"text\/css\"><\/style>\n<p>How to set up SSL on WordPress on an AWS Ubuntu EC2 instance using GoDaddy&#8217;s certificates.<\/p>\n\n\n\n<p>After establishing your GoDaddy SSL certificate to your domain, and verifying it, you will be given the private key and CSR. Then after verifying it, you will have the option in downloading your certificates based on various options, choose &#8220;Apache&#8221;. This will generate a zip download, save that to your computer.<\/p>\n\n\n\n<p>Now copy the private key, certificate (it should look like a random mix of numbers and letters as a .pem file), and the certificate chain (should look like something like this &#8220;gd_bundle-g2-g1.crt&#8221;), into your WordPress instance. Save it somewhere accessible in your instance.<\/p>\n\n\n\n<p>First, you will need to update your WordPress settings to point to HTTPS. In your WordPress dashboard, go to settings then change your URL endpoints to HTTPS. Change the WordPress Address (URL) and Site Address (URL) from HTTP to HTTPS. Save it.<\/p>\n\n\n\n<p>Create an apache config file located in &#8220;<code>\/etc\/apache2\/sites-available<\/code>&#8221; named &#8220;<code>example.com.conf<\/code>&#8221; with the following information:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80>\n  ServerName example.com\n  ServerAlias www.example.com\n\nRedirect permanent \/ https:\/\/example.com\/\n&lt;\/VirtualHost>\n\n&lt;VirtualHost *:443>\n  ServerName example.com\n  ServerAlias www.example.com\n  DocumentRoot \/var\/www\/html\/\n\n  Protocols h2 http:\/1.1\n\n  &lt;If \"%{HTTP_HOST} == 'www.example.com'\">\n    Redirect permanent \/ https:\/\/example.com\/\n  &lt;\/If>\n\n  ErrorLog ${APACHE_LOG_DIR}\/example.com-error.log\n  CustomLog ${APACHE_LOG_DIR}\/example.com-access.log combined\n\n  SSLEngine On\n  SSLCertificateFile \/home\/ubuntu\/cert.pem\n  SSLCertificateKeyFile \/home\/ubuntu\/private.key\n  SSLCertificateChainFile \/home\/ubuntu\/fullchain.crt\n\n  SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH\n  SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1\n  SSLCompression off\n\n  &lt;Directory \/var\/www\/html\/>\n       Options FollowSymlinks\n       AllowOverride All\n       Require all granted\n  &lt;\/Directory>\n\n  &lt;Directory \/var\/www\/html\/>\n       RewriteEngine on\n       RewriteBase \/\n       RewriteCond %{REQUEST_FILENAME} !-f\n       RewriteRule ^(.*) index.php &#91;PT,L]\n  &lt;\/Directory>\n&lt;\/VirtualHost><\/code><\/pre>\n\n\n\n<p>Edit the above config file to point to the proper locations for your GoDaddy certs. And edit the example.com references to your own domain.<\/p>\n\n\n\n<p>Now the the example.com configuration file is created, run the commands below to enable it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2ensite example.com.conf<\/code><\/pre>\n\n\n\n<p>Now enable the following :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enmod ssl\nsudo a2enmod headers\nsudo a2enmod rewrite<\/code><\/pre>\n\n\n\n<p>Now restart Apache: <code>sudo systemctl restart apache2<\/code><\/p>\n\n\n\n<p>Change directory into <code>\/var\/www\/html\/<\/code> and add the following to your <code>.htaccess<\/code> file (within<code> &lt;IfModule mod_rewrite.c&gt;<\/code>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Options +FollowSymLinks\nRewriteCond %{HTTPS} !=on\nRewriteCond %{HTTP_USER_AGENT} ^(.+)$\nRewriteCond %{SERVER_NAME} ^example\\.com$ &#91;OR]\nRewriteCond %{SERVER_NAME} ^www\\.example\\.com$\nRewriteRule .* https:\/\/%{SERVER_NAME}%{REQUEST_URI} &#91;R=301,L]\nHeader add Strict-Transport-Security \"max-age=300\"<\/code><\/pre>\n\n\n\n<p>Replace &#8220;example.com&#8221; with your domain. Save it. Then try to access your website.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to set up SSL on WordPress on an AWS Ubuntu EC2 instance using GoDaddy&#8217;s certificates. After establishing your GoDaddy SSL certificate to your domain, and verifying it, you will be given the private key and CSR. Then after verifying it, you will have the option in downloading your certificates based on various options, choose&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[62,65,64,66,60],"class_list":["post-309","post","type-post","status-publish","format-standard","hentry","category-tech-2","tag-aws","tag-certificates","tag-godaddy","tag-ssl","tag-wordpress"],"_links":{"self":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts\/309"}],"collection":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/comments?post=309"}],"version-history":[{"count":7,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":330,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts\/309\/revisions\/330"}],"wp:attachment":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/media?parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/categories?post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/tags?post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}