Skip to content

Commit bdeb1df

Browse files
authored
Merge pull request #259 from ByteInternet/woocommerce_update
Added some wordpress and Wocommerce docs
2 parents 56e7fe9 + bb72be5 commit bdeb1df

File tree

3 files changed

+169
-0
lines changed

3 files changed

+169
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
myst:
3+
html_meta:
4+
description: Learn how to configure the "Converter for Media – Optimize images
5+
| Convert WebP & AVIF" plugin on your Hypernode server. Follow step-by-step
6+
instructions to verify your VHOST type, update NGINX configuration, and test
7+
the plugin for optimal performance and compatibility with WordPress/WooCommerce.
8+
title: How to Configure "Converter for Media – Optimize images | Convert WebP
9+
& AVIF" Plugin on Hypernode
10+
---
11+
12+
# How to Configure Converter for Media – Optimize images Convert WebP & AVIF Plugin on Hypernode
13+
14+
For the WordPress/WooCommerce plugin [Converter for Media – Optimize images | Convert WebP & AVIF](https://nl.wordpress.org/plugins/webp-converter-for-media/), an adjustment is required in your Hypernode NGINX configuration. To make it easier for you, follow the instructions below to get the plugin working correctly on Hypernode.
15+
16+
## Verify your VHOST type
17+
18+
First, check if your VHOSTS has the correct type by running the following command:
19+
20+
```bash
21+
app@abcdef-example-magweb-cmbl ~ $ hmv --list
22+
```
23+
24+
Running this command will give you an output like this:
25+
26+
```console
27+
+-------------------+----------+----------------+-------+-------------+---------+--------------+
28+
| servername | type | default_server | https | force_https | varnish | ssl_config |
29+
+-------------------+----------+----------------+-------+-------------+---------+--------------+
30+
| test.hypernode.io | magento2 | True | True | True | False | intermediate |
31+
+-------------------+----------+----------------+-------+-------------+---------+--------------+
32+
```
33+
34+
As you can see, the type is incorrect because it needs to be set to WordPress. To change this, use the following command:
35+
36+
```bash
37+
app@abcdef-example-magweb-cmbl ~ $ hmv --type wordpress --https test.hypernode.io
38+
```
39+
40+
After running this command, your VHOSTS will be set to WordPress. Make sure to replace `test.hypernode.io` with your actual domain name.
41+
42+
## Update NGINX configuration for the plugin
43+
44+
To ensure that "Converter for Media – Optimize images | Convert WebP & AVIF" works correctly, apply the following configuration:
45+
46+
```nginx
47+
# BEGIN Converter for Media
48+
set $ext_avif ".avif";
49+
if ($http_accept !~* "image/avif") {
50+
set $ext_avif "";
51+
}
52+
53+
set $ext_webp ".webp";
54+
if ($http_accept !~* "image/webp") {
55+
set $ext_webp "";
56+
}
57+
58+
location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif|webp)$ {
59+
add_header Vary Accept;
60+
add_header Cache-Control "private";
61+
expires 365d;
62+
try_files
63+
/wp-content/uploads-webpc/$path.$ext$ext_avif
64+
/wp-content/uploads-webpc/$path.$ext$ext_webp
65+
$uri =404;
66+
}
67+
# END Converter for Media
68+
```
69+
70+
Place the above configuration in `/data/web/server.media.conf.` Once you save the file, NGINX will automatically reload, and if something goes wrong, you will be notified.
71+
72+
## Test the Configuration
73+
74+
To test the configuration, you can use the following command:
75+
76+
```bash
77+
$ curl -IL -H "Accept: image/webp" https://test.hypernode.io/wp-content/upload/test.jpg
78+
79+
HTTP/2 200
80+
server: nginx
81+
date: Mon, 13 May 2024 08:49:44 GMT
82+
content-type: image/webp
83+
content-length: 53624
84+
last-modified: Wed, 08 May 2024 13:34:25 GMT
85+
etag: "663b7f61-d178"
86+
expires: Tue, 13 May 2025 08:49:44 GMT
87+
cache-control: max-age=31536000
88+
vary: Accept
89+
cache-control: private
90+
accept-ranges: bytes
91+
```
92+
93+
By following these instructions, you should be able to configure and test the "Converter for Media – Optimize images | Convert WebP & AVIF" plugin to work correctly on your Hypernode server.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
myst:
3+
html_meta:
4+
description: Learn how to replace the default WordPress cron with a cron job on
5+
Hypernode to improve performance, schedule tasks precisely, and mitigate DDoS
6+
attacks.
7+
title: How to Set Up a Real Cron Job for WordPress/WooCommerce on Hypernode
8+
---
9+
10+
# How to set up a cron job for WordPress/WooCommerce on Hypernode
11+
12+
In this guide, we'll explain how to replace the default WordPress cron job with a cron job on your Hypernode server. This can be useful for low traffic sites, important tasks that need to be run at specific times, mitigating excessive DDoS attacks, or improving high page load times.
13+
14+
## Disable WordPress cron
15+
16+
To begin, disable the default WordPress cron by editing the wp-config.php file.
17+
18+
Connect to your server using an FTP client like FileZilla or an SSH client such as PuTTY. Navigate to the root directory of your WordPress installation and locate the `wp-config.php` file. Open the file for editing and add the following line of code before `/* That’s all. Stop editing! Happy blogging. */`:
19+
20+
```php
21+
define('DISABLE_WP_CRON', true);
22+
```
23+
24+
This code disables the default WordPress cron functionality, allowing you to set up a cron job.
25+
26+
## Adding a new cron job to your server
27+
28+
Next, set up a cron job on your Hypernode server. Log in to your server via SSH and open your crontab file with the following command:
29+
30+
```bash
31+
app@abcdef-example-magweb-cmbl ~ $ crontab -e
32+
```
33+
34+
Add the following line to your crontab file to set up a cron job that runs every minute:
35+
36+
```console
37+
* * * * * /usr/bin/chronic wget -q -O - 'https://yourdomain.hypernode.io/wp-cron.php?doing_wp_cron'
38+
```
39+
40+
Replace `https://yourdomain.hypernode.io` with the actual URL of your WordPress site.
41+
42+
Explanation of the Cron Job Command
43+
44+
- `* * * * *`: Specifies the interval for the cron job. In this case, it is set to run every minute. You can adjust this based on your needs.
45+
- `wget -q -O - 'https://yourdomain.hypernode.io/wp-cron.php?doing_wp_cron'`: Uses wget to make a web request to the WordPress cron URL, triggering any scheduled tasks.
46+
- `>/dev/null 2>&1`: Discards any output from the command, preventing it from filling up your server logs.
47+
48+
After setting up your cron job, monitor your WordPress site to ensure that scheduled tasks are being executed as expected. This setup ensures that your WordPress or WooCommerce site on Hypernode handles scheduled tasks more reliably, especially under conditions where the default cron system may not suffice.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
myst:
3+
html_meta:
4+
description: How to enhance your WordPress/WooCommerce site's performance using
5+
Redis. Discover the benefits of Redis, recommended plugins, and step-by-step
6+
installation instructions.
7+
title: How to Use Redis with WooCommerce and WordPress on Hypernode
8+
---
9+
10+
# How to Use Redis with WooCommerce and WordPress on Hypernode
11+
12+
Remote Dictionary Server (Redis) is an in-memory, persistent, key-value database known as a data structure server. Unlike similar servers, Redis can store and manipulate high-level data types such as lists, maps, sets, and sorted sets.
13+
14+
By storing important data in its memory, Redis ensures fast data retrieval, significantly boosting performance and reducing response times.
15+
16+
## Which Plugins Can We Use for Redis in WordPress/WooCommerce?
17+
18+
There are several plugins available for Redis. The two most commonly used are [Redis Object Cache](https://wordpress.org/plugins/redis-cache/) and [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/).
19+
20+
Due to the complexity of the cache module in "W3 Total Cache" and the possibility that you may already be using other cache plugins, we recommend the "Redis Object Cache" plugin.
21+
22+
## How to Install Redis Object Cache
23+
24+
Redis is already active on the server on port `6379`.
25+
26+
Next, install the Redis Object Cache plugin via the WordPress Dashboard or using Composer. For detailed installation instructions, please refer to the standard installation procedure for WordPress plugins.
27+
28+
After installing and activating the plugin, navigate to `WordPress` -> `Settings` -> `Redis` or `Network Admin` -> `Settings` -> `Redis on Multisite networks`. Enable the cache and check if the plugin can connect automatically.

0 commit comments

Comments
 (0)