Can I Delete Media Files From My Library if They Have Been Uploaded to Amazon S3
LargeFS and Offloading Media to Amazon S3
LargeFS (Large Files System) is a product created by WP Engine, designed to shop and transfer virtually unlimited amounts of information and integrate it into the familiar WordPress experience. It is specially useful if yous need to use large amounts of media on your website and can help reduce local storage usage.
Be enlightened that while the WP Engine LargeFS service to offload your content is free, an S3 bucket must be purchased and paid for with Amazon. Prices for this saucepan can vary based on the level of service.
For more than information on what LargeFS is, read our announcement mail, Unlimited Storage with WP Engine'southward Proprietary LargeFS.
Setup LargeFS
Configuring LargeFS to work with WP Engine to automatically offload your media to Amazon S3 consists of 4 steps: Create bucket, give WP Engine access, make the bucket readable and provide the bucket to WP Engine Support.
If you lot desire to use LargeFS for multiple sites on the aforementioned account, yous practice not necessarily need to use carve up buckets for each website. Be sure to let our Support squad know which sites will be using which bucket in the final step.
Create Saucepan
- Login to your AWS console
- Choose S3 from the service list
- Click Create Bucket
- Under General configuration:
- Make full in a saucepan proper name
- Select your AWS region – Retrieve this! You will need to provide this subsequently to WP Engine Support
- Under Object Buying, the following items must be set to ensure WP Engine can write to your new bucket:
- Select ACLs Enabled
- Select Object Writer
- Nether Set permissions page , uncheck all iv boxes :
- Block new public ACLs and uploading public objects
- Remove public access granted through public ACLs
- Block new public bucket policies
- Block public and cross-account access if bucket has public policies
- All other settings tin can be left at default
- Gyre to the lesser and click Create bucket
Give WP Engine Admission
Side by side we need to assign the required permissions to the bucket, and so that Big FS tin brainstorm placing files in the saucepan. These permissions grant our WP Engine LargeFS user the rights to read and write objects in your bucket on your behalf.
- Find and select the bucket you just created in the list of buckets
- Click Permissions
- Click Bucket Policy
- In the Bucket policy editor, re-create and paste the policy below
- Replace the placeholder
your-bucket-namewith the bucket name yous've created, there are 3 locations. - Be sure to go along the additional surrounding characters intact when replacing the placeholder text.
- Replace the placeholder
{ "Version": "2008-10-17", "Argument": [ { "Sid": "AllowLargeFSUploads", "Event": "Permit", "Principal": { "AWS": "arn:aws:iam::902500896138:user/wpengine-largefs" }, "Action": [ "s3:ListBucket", "s3:GetObject", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::your-bucket-name", "arn:aws:s3:::your-saucepan-name/*" ] }, { "Sid":"PublicReadGetObject", "Effect":"Allow", "Principal": "*", "Action":["s3:GetObject"], "Resources":[ "arn:aws:s3:::your-saucepan-name/*" ] } ] } - Click Save in the Policy Editor
Make Saucepan Readable
These policy and settings make your bucket world-readable. This is because when WP Engine goes to retrieve your files from the bucket, it does this as if it was a user on the internet.
- ClickProperties
- ClickStatic Website Hosting
- ClickUse this bucket to host a website
- Specifyalphabetize.html as the Alphabetize Document
- ClickSave
Information technology will take some time for AWS to propagate permissions from here.
NOTE: As the bucket is now public, never shop whatsoever non-public files in the bucket. Best do is to not store whatsoever files in the saucepan that are not managed by LargeFS.
Provide Bucket to Support
Contact Back up and include the following:
- Name of the environment
- Bucket name
- Bucket region
- Path
- Default setting is
/wp-content/uploads/however information technology can be whatever directory you continue media in - You may include multiple paths
- Paths cannot be excluded, only included
- Default setting is
The Back up technician will and then walk you through the process of validating your S3 bucket with our arrangement past having you upload a file. This file will be titled with a random cord and cease in a largefs file extension, ex: 123abc.largefs
It's important to upload this file exactly as provided, do not add .txt, .doctor, .html or whatsoever other file extension.
Once this procedure is completed, our organisation volition start copying over files from your local /wp-content/uploads/ to your new Amazon S3 bucket.
We will continue to regularly move new files that are over 10 days erstwhile to this bucket.
Fill-in Logs to Amazon S3
LargeFS can also be configured to automatically offload your Nginx website's access and error logs exist stored to your own S3 bucket. This feature allows you to maintain your log files as long as you lot wish, and access them without needing to login to your website or the WP Engine User Portal.
To have your logs offloaded, you must starting time ensure you have configured a saucepan every bit normal, and have applied the following bucket policy to the bucket. Be certain to supplant your-bucket-proper name with the proper name of the bucket.
{"Version": "2008-10-17","Argument": [{"Sid": "AllowWpeLogsBackup","Effect": "Allow","Chief": {"AWS": "arn:aws:iam::902500896138:user/wpengine-remote-logs"},"Action": ["s3:ListBucket","s3:GetObject","s3:PutObject"],"Resource": ["arn:aws:s3:::your-bucket-name","arn:aws:s3:::your-saucepan-name/*"]}]}
Then, simply accomplish out to WP Engine Support and let us know you'd like your logs configured to offload to LargeFS and the following information:
- s3 bucket region
- s3 bucket proper name
- s3 path (optional, come across annotation below)*
Once admission is verified, the logs will begin exporting a copy to your S3 bucket each night. If you lot encounter whatsoever errors or problems with this process delight contact Support (available 24/seven) in your User Portal for more than help.
Note: Provide WP Engine Back up the S3 path field if you lot wish to supersede the /wpe_logs/environmentname/ directory name with a custom directory name instead.
Custom Log Directory
By default, the files stored to your S3 saucepan will be stored in the following format:
Nginx Log:
/wpe_logs/environmentname/nginx/201807051234-environmentname-apachestyle.log.gz
Apache Log:
/wpe_logs/environmentname/apache/201807051234-environmentname-access.log.gz
Error Log:
/wpe_logs/environmentname/fault/201807051234-environmentname-mistake.log.gz
If you wish to employ a custom folder proper name for your logs, use the bucket policy below instead–recall to replace your-bucket-name with the proper noun of your saucepan and your-log-folder with the name of the folder y'all would like to use:
{ "Version": "2008-10-17", "Statement": [ { "Sid": "AllowWpeBucketRead", "Effect": "Permit", "Primary": { "AWS": "arn:aws:iam::902500896138:user/wpengine-remote-logs" }, "Action": [ "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::your-bucket-name", "arn:aws:s3:::your-bucket-name/*" ] }, { "Sid": "AllowWpeLogFolderWrite", "Issue": "Allow", "Principal": { "AWS": "arn:aws:iam::902500896138:user/wpengine-remote-logs" }, "Activeness": [ "s3:GetObject", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::your-saucepan-name/your-log-binder", "arn:aws:s3:::your-saucepan-proper name/your-log-folder/*" ] } ] } Known Limitations
When using LargeFS, yous are storing your website images in a split up service via Amazon S3, those files no longer be on WP Engine servers. For this reason the following items are known to not work with LargeFS.
- Gravity Forms Plugin
- Woocommerce Product Downloads
- WordPress Download Manager Plugin
- BuddyPress
- Image Pinch Plugins
- Image Resizing Tools
- Hard or Absolute Server Paths
- Duplicate media file names
- Copying To and From Environments
- Deleting Images
- Network Out Bandwidth
- Whatever files which require APACHE PROXY PASS
Beneath further information can exist plant on these limitations and incompatibilities.
Gravity Forms
If you use Gravity Forms for uploads this volition not work with LargeFS. This feature uses hardcoded server paths which means avails must load directly from the WP Engine server, rather than from LargeFS.
BuddyPress
If you are using the Avatar feature for BuddyPress, let our Support team know at setup that the BuddyPress Avatar and Group Avatar directories needs to exist excluded from LargeFS. This feature uses hardcoded server paths which means assets must load directly from the WP Engine server, rather than from LargeFS.
The standard directory paths are:
wp-content/uploads/group-avatars/
wp-content/uploads/avatars/
Prototype Resizing Tools
TimThumb and other PHP-based dynamic image resizing tools. These systems apply a PHP script to manually resize images equally they are requested, requiring the images to be on the server itself. As a result, these dynamic resizing tools volition not work with LargeFS.
However, WordPress has paradigm resizing built in natively now via srcset, so these additional tools should no longer exist needed. The built-in prototype resizing in WordPress works normally with LargeFS.
Paradigm Compression Tools
WP Smush, EWWW Image Optimizer Cloud, and other image pinch tools typically attempt to compress images when they are uploaded. Our LargeFS system waits 10 days subsequently uploading the files to send them to your S3 bucket, so in near cases there are no conflicts.
However, if you e'er change thumbnail sizes or need to regenerate thumbnails, this could crave pulling your images back down from your S3 bucket to your server. Yous can use the steps in our Moving Buckets guide to assistance in copying files to your local machine and then uploading them via SFTP.
Copying Environments
The assets are offloaded to your LargeFS saucepan and removed from WP Engine servers. This means if yous copy one environs to another images volition exist missing on the site you've copied to. In that location are two options:
- Support tin can assist by calculation a fallback rule to copied surroundings
- Ready up LargeFS on the new surround and copy the files through S3
It is not typically recommended to employ LargeFS on more than than 1 surround within the same site (STG, DEV, PRD).
NOTE: If you need to migrate to another bucket entirely, for example in some other region, try our guide.
Hardcoded Server Paths
If you are using a plugin or theme which references images as a path on the server rather than a URL, this may besides conflict with LargeFS. Recall, LargeFS sends your images to your Amazon S3 bucket, so they do non live on a hard server path to exist referenced in this manner. Withal, calling the images as a URL path will work usually with LargeFS.
An epitome referenced as a server path that will not work: /nas/content/live/environment_name/wp-content/uploads/myimage.png
An image referenced at a domain path that will piece of work: mydomain.com/wp-content/uploads/myimage.png.
Files Requiring Direct Access
LargeFS should be used for uploads that are called in a folio rather than accessed straight. Files that need to be executed or opened straight in the browser should not be uploaded to LargeFS, spefically HTML.
Instead, shop these files in a directory outside of those configured to offload to Amazon S3, typically outside of wp-content/uploads/.
Duplicate Media File Names
Media files should have unique names prior to uploading them to your website. This is to prevent files using the same name from existence overwritten afterwards the original has been offloaded to S3.
If a file is uploaded to your website as image.jpg it will be offloaded to S3 presently after and no longer be constitute on the local server. If you proceed to upload a new prototype a few days later too titled image.jpg it will be offloaded to S3 overwriting the previously uploaded version.
The best way to ensure your media files remain unaffected is to develop and use a unique naming construction for media files prior to uploading them to the website.
Deleting Images
If a asset is deleted from the WordPress media library, the prototype must manually exist deleted from the S3 saucepan as well. The LargeFS sync off of WP Engine will non remove files that were deleted from WordPress.
Bandwidth
LargeFS is used to reduce disk usage on your WP Engine server, and it does not bear upon loading times or bandwidth usage. Our servers are nevertheless serving equally a proxy to load the AWS content over your site with the proper URLs, so bandwidth is non reduced with LargeFS.
Network Out Bandwidth
When configuring your Amazon S3 saucepan, you agree to some terms and weather with Amazon. One of these terms is accepting terms of payment for Network Out bandwidth usage for your bucket. Another is the storage usage with Amazon. Be certain to inspect the terms and weather condition for your understanding with Amazon closely, to ensure you understand all charges.
NEXT Pace: Learn how to copy files between Amazon S3 buckets
Source: https://wpengine.com/support/configuring-largefs-store-transfer-unlimited-data/
Post a Comment for "Can I Delete Media Files From My Library if They Have Been Uploaded to Amazon S3"