AWS Lightsail/WordPress Setup, Troubleshooting, & Maintenance
This page is meant for IT professionals who are comfortable on the command line and includes helpful commands and runbooks to assist in managing WordPress instances hosted on AWS Lightsail (Bitnami).
Regular Updates & Maintenance
AWS Lightsail Bitnami Server Updates & Maintenance
WordPress Components Updates & Maintenance
Initial Setup of AWS Lightsail WordPress server
Sign up and create a site:
Create Cloudflare account and log password and delegate access to GHT.
Create account for AWS, then go to Lightsail: https://lightsail.aws.amazon.com/ls/webapp/home
Create a WordPress Lightsail instance in zone US West 2
Assign a static IP to the server in Lightsail
Add/edit A record in public DNS Host
Enter the console and put in the below commands to set the SERVER timezone:
Then run this, making sure to update the language in email address and username if desired:
THEN Add a S to the HTTP to make it HTTPS to the wp-config file for the site:
Install the Level RMM Agent (optional)
Install the RMM agent using the command given to you by the Level interface, then change the hostname:
After the server appears in Level (appears first as ip-123.123.123.123), rename it to the domain name that it will be used to host.
Configure Plugins
Configure UpdraftPlus
Sign in with GHT's Premium Account
Activate products on the site
If restoring a site to this new server, don;t both installing the rest of the plugins listed here.
Setup AWS S3 Backup in Settings, and use GHT key pair to create credentials and bucket.
Configure Fluent SMTP
Create SendInBlue Account for the website.
Under the SendInBlue settings, Domains, add the domain. Authenticate the domain by adding the DNS records provided
If able, add this comment to all DNS records created in the registrar: SendInBlue DKIM for WordPress.
In addition, be sure to add this to the SPF record: include:sendinblue.com
Generate an API key and store it in a password solution.
Install the FluentSMTP plugin and configure the SendInBlue from email using the API key.
Send a test email to yourself to very the email is working and goes to Inbox.
Upload the Avada premium theme from the GHT SharePoint Internal site.
Activate the theme and install the required plugins as directed.
Avada - Navigate to the IP of the lightsail instance, upload the Avada theme, and go to the Avada registration tab in WP. Click on Generate Envato token. Create an account and verify by email. Get the token and document it.
Install/activate the Google Site Kit plugin and proceed through the setup wizard.
Install/activate the Cloudflare plugin and proceed through the setup wizard. Input the API key and Apply recommended Settings
Linode WordPress
These are alternative instructions for if you are running WordPress on Linode.
Get Linode WordPress Credentials
cat /root/.linode_credentials.txt
Linode Edit WP-Config.php file to edit the site URL:
nano /var/www/172-232-163-61.ip.linodeusercontent.com/public_html/wp-config.php
Update these Lines:
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/' );
define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/' );
SET the Wordpress URL config in the DB:
update wp_options set option_value="http://new.myplacesce.org" where option_name="home" or option_name="siteurl";
Then, we can view the output of the Wordpress uRL config in the DB:
select option_name, option_value from wp_options where option_name="home" or option_name="siteurl";
PHP Configuration File (Changes based on PHP version)
nano /etc/php/8.1/cli/php.ini
General Troubleshooting and Reporting Commands
First Troubleshooting Step - Deactivate all plugins:
Update UUID (allows you to install RMM tools):
Update timezone:
Restart All Services:
Restart Apache:
Stop apache server:
Get admin (root) password:
Username: user
^^ use this username and password to login to your new wordpress instance using the /wp-login page.
Get admin (root) password:
Username: user
^^ use this username and password to login to your new wordpress instance using the /wp-login page.
Deactivate plugin via command line:
Delete all plugins:
Enable WordPress Logging and go to log file
Check WordPress Installation and Reinstall
Then change to the WordPress directory to use 'rm' to remove the bad files.
Config htaccess for plugin access:
Check Disk Space:
Check Disk Space on a directory:
Reset permissions for WordPress:
from: https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors/
Plugins folder path on bitnami instances:
Reset permissions on the plugins directory:
Access & Other Server Settings
Find files:
Find and Delete files:
Edit PHP configuration (like to increase file upload limit):
hit F6 to search for php properties, and use this to find their name: https://www.php.net/manual/en/ini.core.php
Edit WordPress functions.php configuration (for Avada):
Edit .htaccess file via vi command:
Create .htpasswd file (for custom directory security):
Database Management
Connect to the database
Import data into database:
Drop Tables after connecting
More info on troubleshooting and permissions reset:
Archived Commands
Plugin Setup (no longer needed if using external email service like SendInBlue)
Add AWS SES keys to wp-config:
Last updated