WordPress with Elastic Beanstalk CLI - wordpress

We have a website hosting with AWS Elastic Beanstalk and are using the eb deploy command to upload changes, etc... The issue I am having is it seems to overwrite any files that were uploaded using the WordPress dashboard when I deploy new changes. I tried adding wp-content/uploads to my .ebignore but then all images on the website are dead. Is there a way to not overwrite this folder at all?

You should never upload files to a server running on Elastic Beanstalk. Those files will be lost at some point, either during a deployment or a scale-in event or something else. The only method of making changes to your EB server should be through the eb deploy command. In addition that method of storing files will not work at all once you scale up your EB environment to multiple servers.
You should be utilizing the AWS S3 service for image storage. There are several Wordpress plugins that facilitate storage of images on S3.

Related

AWS pipeline and Github

I'm new to AWS CI/CD. We current have one wordpress website running on two AWS EC2 instances, the live site is on the AWS EC2 instance for live, and the staging one is with the development EC2 instance and I put part of my codes on Github, getting rid of files like plugins. The github repository has two branches, one is development and another is Master. I current want to create one pipeline so once I push code to development branch, it will auto update the code of the staging site and once I merge the development with the Master branch, the code on the live site will be updated.
This is not the new instance from AWS elastic beanstalk at the beginning, so can I set up the AWS pipeline on the exsiting EC2 instances? and will that overwrite the other files not tracked by Git? I don't want those plugins files overwriten when I set up the pipeline.
If they're all possible, how should I set up it? Anyone can give me a logic brief?
I current want to create one pipeline
Sadly you can't do this. You need one CodePipeline (CP) for each branch. Thus you need two CPs, one for master branch and second for the dev branch.
This is not the new instance from AWS elastic beanstalk at the beginning, so can I set up the AWS pipeline on the existing EC2 instances?
Yes, you have to use CP's Elastic Beanstalk (EB) deploy action provider. Since you have two EB environments, each CPs will deploy to its respective EB instance (one for master, and second for dev).
and will that overwrite the other files not tracked by Git? I don't want those plugins files overwriten when I set up the pipeline.
Not sure what do you mean, but during deployment everything that is in the application folder on EB (/var/app/current) will be deleted and replaced with new version of your application.

How to setup docker-compose to work with app engine and wordpress?

I am using gitlab ci/cd to deploy my app to google app engine. I already have php instance working properly but when i try build wordpress image using docker-compose, nothing happen.
these are my files:
I have a folder "web" with a files ping.php: https://site-dot-standalone-applications.appspot.com/ping.php
So application is running into /web folder.
wordpress should be deployed into /web folder after:
docker-compose up
UPDATE
Just needed use the following gitlab-ci.yaml:
Unfortunately, you cannot (easily) deploy containers to App Engine Flex this way.
At its simplest, App Engine Flex is a service that combines a load-balancer, an auto-scaler and your docker image. Your image when run as a container is expected to provide an HTTP/S endpoint on port 8080.
There are 2 ways that App Engine could support your deployment but it does neither:
It bundles a WordPress app image and a MySQL image into a single "pod" and exposes WordPress' HTTP port on :8080. This isn't what you want because then each WordPress instance has its own MySQL instance.
It separates the WordPress app into one service and the MySQL app into another service. This is closer to what you want as you could then scale the WordPress instances independently of the MySQL instances. However, databases are the definitive stateful app and you don't want to run these as App Engine services.
The second case suggests some alternative approaches for you to consider:
Deploy your WordPress app to App Engine but use Google Cloud SQL service link.
If you don't want to use Cloud SQL, you could run your MySQL database on Compute Engine link.
You may wish to consider Kubernetes Engine. This would permit both the approaches outlined above and there are tools that help you migrate from docker-compose files to Kubernetes configurations link.
Since you're familiar with App Engine, I recommend you consider using option #1 above (Cloud SQL)

How can I move my AWS Lightsail Account to a different hosting provider?

I been trying to figure out how can I migrate my site from AWS-Lightsail to another hosting provider. Normally I would just download all the files from my file directory then upload them to the new hosting provider but I can't even access my files through AWS Lightsail.
Can someone please help me figure out how to download the contents of my WordPress site/database so I can switch hosting providers?
The recommended method to upload / download files to / from Amazon Lightsail is using SFTP. There are several SSH based file browsers. I work with Windows so I use Bitvise. From the Amazon Lightsail Console download your SSH Keypair.
Follow the documentation for your SSH / SFTP client and setup the SSH Keypair and then connect to your instance. You can then upload / download files.
Use a WordPress backup and restore program such as https://wordpress.org/plugins/updraftplus/ . The free version does perfect backup and restores from one host to another. Maybe get a technician to help you if you don't feel comfortable with it. This seems to be a ServerFault issue though?

Image & video library uploads AWS, cloud front using asp.net

I need to develop an web based app in .net and upload image, Files and videos to AWS using asp.net and also make these files downloadable using link to aws source.
Looking at Amazon AWS sort of confused me. with so many products.
I would appreciate how can we develop .net based app which will upload different kinds of large files to amazon aws .
We want to host this app on different Server and upload file to aws server.
Not sure where to start from of what products to look for on amazon.
Confused with cloud front, amzon buckets etc..
After re-reading your question and noticing that you want to host your app externally to AWS, all you will need at this point is:
S3 (Simple Storage Storage)
This will host your static files - images, videos, files. Files stored in S3 can be made publically accessible via URL.
Your .NET application will make use of the AWS S3 SDK for interacting with your S3 bucket. This abstracts the technical details and makes it simple to CRUD files in S3.
Here's an example of the code you'll need.
At a high level, what you'll need to do:
Create Amazon AWS account
Create S3 bucket
Include AWS S3 SDK to your application
Deploy and test
Authentication
If you want to make some or all of the files in your S3 bucket public, you will create a bucket policy.
As your application is not going to be hosted in AWS, you will be authenticating using access keys, ensure these are protected and also ensure these are not generated from your root AWS account.

deploying wabapps (e.g. moodle) on heroku

What is the proper way to deploy webapps on Heroku? I'm installing Moodle, but the same procedure should apply to e.g. Drupal or Wordpress. What I hace done is to unzip Moodle locally, then uploaded it using git to Heroku. When I then visit my site I get the option to install it and select the database, which works fine. The problem is that the install procedure saves information in the filesystem on the server, which gets overwritten next time I deploy my app. So what is the proper way of doing this?
You have to pre-configure your app with all of the database settings before you deploy to Heroku. So either do a fake "install" on your local environment, or manually edit your php config files.
As you've discovered, Heroku's filesystem is not persistent: https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem.

Resources