- Newest
- Most votes
- Most comments
To address the issues you're facing with your Elastic Beanstalk application running Apache and PHP 8 for multiple WordPress versions, I can suggest a few approaches:
-
Immutable Deployments: Instead of relying on rolling updates, consider using immutable deployments. This method creates an entirely new set of instances with the new version, ensuring all required configurations and versions are present. Once the new instances are healthy, traffic is shifted to them, and the old instances are terminated. This approach can help ensure all your site groups are properly deployed on each instance.
-
Custom AMI: Create a custom Amazon Machine Image (AMI) that includes all the necessary WordPress versions, Apache configurations, and SSL certificates. Use this AMI as the base for your Elastic Beanstalk environment. This way, when new instances are launched, they will already have all the required components.
-
Deployment Scripts: Implement deployment scripts that run on instance launch to pull and set up all required WordPress versions and configurations. These scripts can be included in your Elastic Beanstalk application bundle and executed during the deployment process.
-
Separate Environments: Consider creating separate Elastic Beanstalk environments for each group of sites or WordPress version. This approach, while increasing the number of environments, ensures that each group is managed independently and reduces the complexity of maintaining multiple versions in a single environment.
Regarding the Apache configuration persistence issue:
The error you're encountering suggests that Apache is having trouble reading its configuration from the EFS mount. This is likely due to security restrictions. Instead of symlinking the entire configuration directories, consider the following:
-
Store the configuration files on EFS, but copy them to the local filesystem during instance startup or deployment.
-
Use a custom platform hook or an .ebextensions configuration file to copy the necessary files from EFS to the appropriate local directories on instance launch.
-
If possible, keep the Apache configuration files local to the EC2 instances and use other methods (like S3 or a configuration management tool) to ensure consistency across instances.
-
For SSL certificates, consider using AWS Certificate Manager (ACM) instead of storing them on EFS. ACM integrates well with Elastic Beanstalk and eliminates the need to manage certificate files directly.
By implementing these strategies, you should be able to maintain multiple WordPress versions and persist Apache configurations without encountering the issues you're currently facing.
Sources
Seamless Production Deployment with Elastic Beanstalk | .NET on AWS Blog
Immutable environment updates - AWS Elastic Beanstalk
answered a year ago
Relevant content
asked 2 years ago
asked a year ago
