101 Useful things to know. #1
It’s fairly easy to set up WordPress (WP) instances in AWS but there are few things that are annoying.
If you install WP on Lightsail you will notice in your WP admin that if you go to General / Settings then you cannot change the default url’s to be ssl and/or to be your domain rather than the public IP address. They are greyed out and you cannot edit them.
This can cause problems with other plugins and it also means your default URL’s are not SSL within WP
You can fix this easily though with little technical knowledge.
Login at https://lightsail.aws.amazon.com/ls/webapp/home/instance and for the instance you want to change click the SSH connect icon:
in the terminal window type:
“cd apps/wordpress/htdocs/“ (without quotes) and hit RETURN
Type “dir” (without quotes) and hit RETURN key. You should see this:
type: “vim wp-config.php” (without quotes)
use the down arrow on your keyboard to find the lines that contains the code:
define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/’);
define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/’);
type the letter i – this means you can edit the code. now edit these lines to
define( ‘WP_HOME’, ‘https://yourdomain.com’ );
define( ‘WP_SITEURL’, ‘https://yourdomain.com’ );
press ESC on your keyboard
then type “:wq” (without quotes) and press ENTER, this will write the changes and quit the editor.
close the Terminal window.
Go back to the instance page and click reboot.
once it has come back up – log into your WordPress admin / go to Settings/ general and you should see it has updated.