How to — install WordPress on EC2 connected to RDS (AWS)
I’ll skip all that create & setup instances parts
but, this is gonna be long article anyway…
Install things on EC2
Access to EC2 via Terminal and run this command (one by one) to install what we need for running WordPress site.
sudo yum install php
sudo yum install httpd
sudo yum install mysql
Start Web Server
sudo service httpd start
After this command, check if the server is running by access to your EC2 URL (you can get this in EC2 Management Console)
If you see Apache start page, we’re good to go!
Connect to Database in RDS
Go to this folder
Create file config
Paste this code
rds_endpoint = your RDS Instance URL
Upload WordPress.zip via FTP
Now we need to upload WordPress.zip to EC2 (I’ll skip how to connect via FTP)
Your Wordpress.zip needs to be here
and then unzip the files, use this command
I hope you knew how to install WordPress already, just go to EC2 URL and the installation page should be there.
But, if you have problem, keep reading…
Problem & Solutions for Installing WordPress on EC2
Cannot update WordPress, Theme, or Plugins?
We need to tell EC2 that Apache is the owner of this folder
Run these commands
sudo chown -R apache /var/www/html
sudo chmod -R 755 /var/www/html
Also, go to folder wp-content and give permission for folder Upgrade
sudo chmod -R 0777 upgrade
Failed to update Plugins in Dashboard?
Go to wp-config.php and paste this code (wherever)
Cannot upload files to WordPress Media Library?
Go to folder wp-content and give permission for folder Uploads
sudo chmod -R 0777 uploads
If you have any other problem just leave comment,
I’m happy to help ;)