After working off and on for a couple of weeks I finally got one of my WordPress web sites RideOK.com migrated to Amazon Web Services. And it is FAST!
For this first migration I installed WordPress on a t2.micro EC2 instance. I was a bit concerned that it might not have enough performance, but so far it has worked great and I can easily scale up performance as needed by simply stopping the instance, changing the size, and restarting it.
I configured the EC2 instance from a Bitnami configuration for WordPress. It runs Ubuntu Linux, PHP 7.1, MySQL (which I decided not to use) and NGINX web server, which is new to me. On hindsight I would have rather used Apache, which I am more familiar with, but NGINX works fine. It is just a new learning curve.
There were a few odd things about how Bitnami configured the users and groups and file security. It took me a while to figure out proper security for all my wordpress files. NGINX runs as the “daemon” user in the “daemon” group. When I upload files I am user name “Bitnami”. It took me a while to figure out what user and group NGINX was using and then to add Bitnami to that group and set security properly on all the WordPress files. Once I had everything configured and running I set the word-config file to Unix permissions 640 so that the user and group could see and execute the file but others could not even see or execute the file.
I set up Amazon RDS as my database rather than MySQL. Even though RDS is based on MySQL, it is much more reliable and scalable. Amazon makes it quite easy to manage RDS databases, back them up, scale them to multiple regions. It would take me a LOT of work to do all that in MySQL and RDS does all that work for me. Easy decision.
My original plan was to use Amazon Elastic File Store for my WordPress wp-content folder – the folder that holds images, css files, themes, and plugins. I had some trouble getting this configured properly and finally got tired of messing with it and just decided to use Amazon EBS instead. EFS is like a network file system or network server, while EBS is like attaching physical hard drives to your EC2 instance. EBS isn’t scalable with WordPress but for now I really don’t need the scalability and figure I will tackle that hurdle at a later date.
Next – DOCKER
Now that I have RideOK.com up and running on a stand-alone EC2 instances and Amazon RDS, my next plan is to bring up my next site in Docker containers. This will allow me to run a single EC2 instance and have isolated sites in each Docker container. I will still used RDS for my database and EBS for file storage, but my plan is to run each WordPress site in a Docker container. I currently am figuring out how to map shared space in Docker, pass my WordPress configuration file to Docker when I start it up, and try to make it so that I can easily move my Docker containers around as needed.