Enable Https On Wordpress Inwards Amazon

This tutorial volition assistance us install Wordpress on Amazon using a Wordpress picture provided past times Bitnami. We volition likewise enable HTTPS past times using an Amazon's elastic charge balancer as well as a WordPress plugin.

Steps

  1. Create an EC2 event as well as install this Wordpress picture from Bitnami: https://aws.amazon.com/marketplace/pp/B00NN8Y43U.
  2. Install Easy Https Redirection plugin on Wordpress - https://wordpress.org/plugins/https-redirection/
  3. Configure Elastic Load Balancing With SSL And AWS Certificate Manager For Bitnami Applications On AWS - https://docs.bitnami.com/aws/how-to/configure-elb-ssl-aws/
    These lines should live added earlier WP_HOME as well as WP_SITEURL:
    if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)     $_SERVER['HTTPS']='on'; 
  4. At this stage, your URL should both live accessible via HTTP as well as HTTPS, only nosotros desire to forcefulness a redirect to HTTPS then nosotros postulate to produce this finally step.
    1. Reopen /apps/wordpress/conf/httpd-prefix.conf as well as add together the next lines:
      RewriteCond %{HTTPS} !=on RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
  5. And finally, don't forget to restart the apache server: /opt/bitnami/ctlscript.sh restart apache

The finally version of the file should await similar below. Take depository fiscal establishment notation of the commented lines, those are the originals.
SetEnvIf x-forwarded-proto https HTTPS=on  # App url moved to root DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"     #Alias /wordpress/ "/opt/bitnami/apps/wordpress/htdocs/" #Alias /wordpress "/opt/bitnami/apps/wordpress/htdocs"  RewriteEngine On #RewriteCond "%{HTTP_HOST}" ^ec2-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})\..*\.amazonaws.com(:[0-9]*)?$ #RewriteRule "^/?(.*)" "%{REQUEST_SCHEME}://%1.%2.%3.%4%5/$1" [L,R=302,NE]  #RewriteCond %{HTTPS} !=on #RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]  RewriteCond %{HTTPS} !=on RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]  Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf" 

Video Tutorial: https://www.youtube.com/watch?v=WQwvwiPZlZE
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.