{"id":14070513,"url":"https://github.com/MikletNg/aws-serverless-wordpress","last_synced_at":"2025-07-30T07:33:37.214Z","repository":{"id":48790079,"uuid":"297292908","full_name":"MikletNg/aws-serverless-wordpress","owner":"MikletNg","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-09T10:55:17.000Z","size":1348,"stargazers_count":82,"open_issues_count":0,"forks_count":38,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-08-13T07:18:04.301Z","etag":null,"topics":["aurora-serverless","aws-cdk","aws-efs","aws-elasticache","aws-fargate","aws-rds","aws-route53","aws-s3","aws-xray","cloudfront","docker","memcached","serverless","wordpress"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MikletNg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-21T09:34:24.000Z","updated_at":"2024-08-02T07:00:28.000Z","dependencies_parsed_at":"2022-08-28T20:50:08.302Z","dependency_job_id":null,"html_url":"https://github.com/MikletNg/aws-serverless-wordpress","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikletNg%2Faws-serverless-wordpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikletNg%2Faws-serverless-wordpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikletNg%2Faws-serverless-wordpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikletNg%2Faws-serverless-wordpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MikletNg","download_url":"https://codeload.github.com/MikletNg/aws-serverless-wordpress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228110407,"owners_count":17871173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aurora-serverless","aws-cdk","aws-efs","aws-elasticache","aws-fargate","aws-rds","aws-route53","aws-s3","aws-xray","cloudfront","docker","memcached","serverless","wordpress"],"created_at":"2024-08-13T07:07:49.356Z","updated_at":"2024-12-04T12:31:15.954Z","avatar_url":"https://github.com/MikletNg.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# AWS Serverless WordPress\r\n\r\n## Introduction\r\nPlease read the blog post for introduction and explanation.\r\n[Dev.to: Best Practices for Running WordPress on AWS using CDK](https://dev.to/aws-builders/best-practices-for-running-wordpress-on-aws-using-cdk-aj9)\r\n\r\n### WordPress Plugin Used\r\n- W3 Total Cache\r\n- WP Offload Media Lite\r\n- ElasticPress\r\n- Multiple Domain\r\n- HumanMade - AWS-XRay (Working on making it work...)\r\n\r\n## Architecture Diagram\r\n![Architecture Diagram](doc/architecture-diagram-v2.png)\r\n\r\n## Deployment - (To be update)\r\n### Before getting started\r\nPlease make sure you have/are\r\n- Using bash\r\n- Node.js installed\r\n- NPM and Yarn installed\r\n- Installed and running Docker\r\n- Installed and configured AWS CLI\r\n- Installed the latest version of AWS CDK CLI\r\n\r\n*Please be notice, this stack only can deploy into us-east-1*\r\n0. You should have a public hosted zone in Route 53\r\n1. Initialize the CDK project, run `make init`\r\n2. Deploy the CDK Toolkit stack on to the target region, run `cdk bootstrap aws://AWS_ACCOUNT_ID/AWS_REGION --profile AWS_PROFILE_NAME`\r\n3. Copy the `config.sample.toml` and rename to `config.toml`\r\n4. Run `make easy-rsa-init gen-cert import-cert` to generate the certificate for the Client VPN\r\n5. Modify the configuration in `config.toml`\r\n    ```toml\r\n   [environment]\r\n   account = \"YOUR_AWS_ACCOUNT_ID\" # Your AWS account ID\r\n   \r\n   [admin]\r\n   allowIpAddresses = [\"0.0.0.0/0\"] #Your home/office public IPv4 address, if using a specific IP add /32 like 24.222.174.192/32\r\n   \r\n   #Both certificate ARN should create and get from the previous steps\r\n   serverCertificateArn = \"arn:aws:acm:us-east-1:YOUR_AWS_ACCOUNT_ID:certificate/xxxxxxxxxxxxxxxxxxxxxxxx\"\r\n   clientCertificateArn = \"arn:aws:acm:us-east-1:YOUR_AWS_ACCOUNT_ID:certificate/yyyyyyyyyyyyyyyyyyyyyyyy\"\r\n   \r\n   [database]\r\n   username = \"wordpress\" #Database username\r\n   defaultDatabaseName = \"wordpress\" #Default database name\r\n   \r\n   [domain]\r\n   domainName = \"example.com\" #Your root domain name, useually is the domain name of the created public hosted zone in Route 53\r\n   hostname = \"blog.example.com\" #Your desire hostname for the WordPress\r\n   alternativeHostname = [\"*.blog.example.com\"]\r\n   \r\n   [contact]\r\n   email = [\"hello@blog.example.com\"] #Email address for notify any in-compliance event in AWS Config\r\n    ```\r\n6. Run `make deploy profile=YOUR_AWS_PROFILE_NAME`\r\n7. After the CloudFormation stack deployed, open the Session Manager in System Manager, and open a session to the created bastion host. Then run the following command. (The version of WordPress plugin may NOT be latest)\r\n    ```shell script\r\n    sudo su -\r\n    cd /mnt/efs/wp-content/plugins \u0026\u0026\\\r\n    curl -O https://downloads.wordpress.org/plugin/w3-total-cache.0.15.1.zip \u0026\u0026\\\r\n    curl -O https://downloads.wordpress.org/plugin/amazon-s3-and-cloudfront.2.4.4.zip \u0026\u0026\\\r\n    curl -O https://downloads.wordpress.org/plugin/elasticpress.zip \u0026\u0026\\\r\n    curl -O https://downloads.wordpress.org/plugin/multiple-domain.zip \u0026\u0026\\\r\n    curl https://codeload.github.com/humanmade/aws-xray/zip/1.2.12 -o humanmade-aws-xray-1.2.12.zip \u0026\u0026\\\r\n    unzip '*.zip' \u0026\u0026\\\r\n    rm -rf *.zip\r\n    ```\r\n8. After the installation, go to the webpage and setup the database connection and plugin configuration. For the hostname of Memcached or MySQL, please check the output in CloudFormation stack.\r\n9. For `Mutiple Domain` plugin, please enter `blog.example.com` and `admin.blog.example.com` these 2 hostname.\r\n\r\n## References\r\nhttps://aws.amazon.com/tw/blogs/devops/build-a-continuous-delivery-pipeline-for-your-container-images-with-amazon-ecr-as-source/\r\nhttps://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green.html\r\n\r\nhttps://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-ecs-ecr-codedeploy.html#tutorials-ecs-ecr-codedeploy-cluster\r\nhttps://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html\r\nhttps://stackoverflow.com/questions/56535632/how-do-i-link-2-containers-running-in-a-aws-ecs-task\r\n\r\nhttps://github.com/Monogramm/docker-wordpress\r\nhttps://github.com/fjudith/docker-wordpress\r\nhttps://github.com/humanmade/aws-xray\r\n\r\nhttps://pecl.php.net/package/memcached\r\nhttps://pecl.php.net/package/APCu\r\n\r\nhttps://stackoverflow.com/questions/54772120/docker-links-with-awsvpc-network-mode\r\n\r\nhttps://www.mgt-commerce.com/blog/aws-varnish-auto-scaling-magento/\r\n\r\nhttps://downloads.wordpress.org/plugin/w3-total-cache.0.15.1.zip\r\nhttps://downloads.wordpress.org/plugin/wp-ses.1.4.3.zip\r\nhttps://downloads.wordpress.org/plugin/amazon-s3-and-cloudfront.2.4.4.zip\r\nhttps://downloads.wordpress.org/plugin/elasticpress.zip\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMikletNg%2Faws-serverless-wordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMikletNg%2Faws-serverless-wordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMikletNg%2Faws-serverless-wordpress/lists"}