exception_thrown
exception_thrown

Reputation: 586

Wordpress Auto Scaling Updating

I have a wordpress site running on apache on two EC2 instances behind a ALB with Auto scaling set.

I am using another instance that is not behind the ALB and independent to make my changes/updates to the wordpress site and then creating a AMI with it. This allows me to update my scaling launch config with the newest AMI and roll the update to the two production instances behind the ALB.

I feel like there has to be a better way to do this, as this seems like a lot of work to create updates. As having the change the wordpress url from the developement EC2 instance and then creating the image and so on.

Is there anyway that this process can be automated? or is the only to just roll the updates on docker locally to codedeploy?

Upvotes: 0

Views: 461

Answers (2)

l682
l682

Reputation: 11

In my experience, the best way is to use Elastic Beanstalk with RDS for the database and S3 for storing media files.

In the beginning, you have to invest some time in all the configurations but then you can work with a solid solution easy to update.

Here some docs:

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html

https://www.essycode.com/posts/wordpress-and-elastic-beanstalk/

Upvotes: 0

Ivan Carcamo
Ivan Carcamo

Reputation: 734

There are many ways of doing so, but in my experience with Wordpress (WP), none of them seems to be flawless.

If your way of doing it works, that's ok; what you can do is to automate it and trigger the whole process until it gets completed with a single Click (depending on your code hosting you can create a pipeline, i.e. github actions, gitlab ci/cd, bitbucket pipelines, etc. ).

Here's another way of doing WP development (taken from a course in LinuxAcademy): WP development acrhictecture

Using the image architechture:

  • all the ec2 instances (dev and prod), share the same database
  • push means aws s3 cp <source folder ><destination bucket>
  • pull means aws s3 sync <source bucket> <destination folder>
  • No more AMI re-creations, a simple cron job to update Production
  • You have to handle the wp-config.php differences between instances (if any)

Upvotes: 1

Related Questions