Skip to content

Commit 88076c0

Browse files
committed
improve sentences, add subchapters
1 parent e19bb6f commit 88076c0

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

docs/ecommerce-applications/magento-2/how-to-configure-remote-storage-for-magento-2-x.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,62 +52,67 @@ bin/magento setup:config:set \
5252
--remote-storage-endpoint="https://my-s3-compatible.endpoint.com"
5353
```
5454

55-
## Syncing the files
55+
## Syncing the files (efficiently)
5656

57-
Instead of running (which is Magento's official way to do this):
57+
Magento provides an official method for syncing files using the following command (not recommended):
5858

5959
```bash
6060
bin/magento remote-storage:sync
6161
```
62-
63-
you can run the following to really speed up the process:
62+
However, for significantly improved performance, you can use the following alternative:
6463

6564
```bash
6665
hypernode-object-storage objects sync pub/media/ s3://my_bucket_name/media/
6766
hypernode-object-storage objects sync var/import_export s3://my_bucket_name/import_export
6867
```
6968

70-
`hypernode-object-storage objects sync` will run a sync process in the background for you,
71-
and will tell you what the PID of that process is. With the PID you can run the following
72-
command to check up on the progress of the sync:
69+
The `hypernode-object-storage objects sync` command runs the sync process in the background
70+
and provides the Process ID (PID). You can monitor the sync progress using:
7371

7472
```bash
7573
hypernode-object-storage objects show PID
7674
```
7775

78-
Alternatively, you can run the `aws s3 sync` command directly:
76+
Alternatively, you can use the AWS CLI directly:
7977

8078
```bash
8179
aws s3 sync pub/media/ s3://my_bucket_name/media/
8280
aws s3 sync var/import_export s3://my_bucket_name/import_export
8381
```
84-
85-
In any case, that is much faster than Magento's built-in sync, because `aws s3 sync` uploads files concurrently.
82+
Both methods are significantly faster than Magento’s built-in sync, as aws s3 sync handles uploads concurrently.
8683

8784
## The storage flag file in the bucket
8885

8986
Magento's S3 implementation creates a test file called `storage.flag`, which is basically created to test if the connection works. So this is not a magic file to mark anything ([source](https://github.com/magento/magento2/blob/6f4805f82bb7511f72935daa493d48ebda3d9039/app/code/Magento/AwsS3/Driver/AwsS3.php#L104)).
9087

9188
## Serving assets from your S3 bucket
9289

93-
To start serving media assets from your S3 bucket, you need to make some adjustments to your nginx configuration. Luckily, `hypernode-manage-vhosts` does this for you! If you are using Hypernode's object storage solution, all you need to do is run the following for relevant vhosts:
90+
To serve media assets directly from your S3 bucket, you need to adjust your Nginx configuration.
91+
Fortunately, `hypernode-manage-vhosts` simplifies this process for you. If you're using Hypernode's object storage solution,
92+
simply run the following command for the relevant vhosts:
9493

9594
```bash
9695
hmv example.com --object-storage
9796
```
97+
### Using a custom object storage solution
98+
99+
If you're using a custom storage provider, such as Amazon S3, you'll need to specify the bucket name and URL manually:
98100

99-
In the case that you're using custom object storage, such as Amazon's S3, you will need to supply the bucket name and the bucket URL yourself:
100101
```bash
101102
hmv example.com --object-storage --object-storage-bucket mybucket --object-storage-url https://example_url.com
102103
```
103104

104-
If you have previously set your own custom bucket name and URL, but have since switched to Hypernode's object storage solution, then you can use the `--object-storage-defaults` flag to force overwrite your values to Hypernode's default ones:
105+
### Switching back to Hypernode defaults
106+
107+
If you previously set a custom bucket and URL but want to revert to Hypernode's default object storage, use the `--object-storage-defaults` flag:
105108

106109
```bash
107-
hmv example.com --object-storage --object-storage-defaults
110+
hmv example.com --object-storage-defaults
108111
```
109112

110-
Furthermore, if you're using Amazon S3 as your bucket, ensure that your S3 bucket policies are configured correctly, so that only `/media` is publicly readable. For example:
113+
### Configuring Amazon S3 bucket policies
114+
115+
If you’re using Amazon S3, ensure that your S3 bucket policies are properly configured so that only the `/media` directory is publicly accessible. For example:
111116

112117
```json
113118
{

0 commit comments

Comments
 (0)