Lightest possible setup for wordpress website

hi,
what would be the lightest possible setup to run a wordpress site and making sure it runs very fast?

on this page i found a very easy light setup. does anybody use this kind of setup? do you have any recommendations?

https://rand.1to.one/optimize-hestiacp-for-speed-and-fast-wordpress/


Nginx + PHP + MySQL/MariaDB – without Apache .

wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh

sudo bash hst-install.sh --apache no --phpfpm yes --multiphp no --vsftpd no --proftpd no --named no --mysql yes --postgresql no --exim yes --dovecot yes --sieve no --clamav no --spamassassin no --iptables yes --fail2ban yes --interactive yes

This will give us minimal installation, without BIND (DNS), and only EXIM as mailing solution.

3. Set WordPress template and caching

Login to control panel and your user.

Set tamplate

  • Edit Web domain → Advanced Options → Web Template → WordPress

Set caching

  • Enable Fast CGI Cache
  • Set Cache duration → 5m, 10m
    (if you have a lot of dynamic content, you can try microcache of 30s).

That’s it on the HestiaCP side, now your website should be crazy fast. For further optimisations, look into optimizing WP plugins and theme code.

1 Like

I agree with that.

1 Like

I want to add to this guide interesting thing related to hestiaCP nginx & cloudflare.
By default cloudflare will NOT cache static resources with wordpress nginx template.

I do talk about this

On the screenshot it’s HIT. I.e. correct behavior. Means: static resources like js files, css files, images - cached by cloudflare and downloaded from cloudflare servers instead of my hestiaCP.

How to check?
CTRL + SHIFT + C or F12 in Edge or Google Chrome → Network tab.
CTRL + R or CTRL+F5 (mark button on screenshot above: “disable cache”)
and you will see headgears (if you click on any file).

You will see there MISS. This is default behavior.
But why? If you have enabled caching, and you have headers for cache (max-age) why do you have MISS?

Here is a thing: Default Cache Behavior · Cloudflare Cache (CDN) docs

I.e. you must to have have both: max-age & Cache-Control header public.

How have I fixed it for myself (i’m not sure that if this is right thing to do, I need some professional to comment this).

(i have ubuntu 22.04)
I went here: /usr/local/hestia/data/templates/web/nginx/php-fpm

and made copy-paste of these 2 files:

  • wordpress.tpl
  • wordpress.stpl

to:

  • mywordpress.tpl
  • mywordpress.spl

Inside both mywordpress files

in block:

        try_files $uri $uri/ /index.php?$args;
        location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
            expires 30d;
            fastcgi_hide_header "Set-Cookie";
        }

I’ve added just 1 line:

add_header Cache-Control “public”;

So I got next looking block (in both files)

    location / {
        try_files $uri $uri/ /index.php?$args;
        location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
            expires 30d;
            add_header Cache-Control "public";
            fastcgi_hide_header "Set-Cookie";
        }

After that I saved files.
And changed wordpress template in hestiaCP admin for website to mywordpress template.
Cleaned cached on Cloudflare side.

And now I have dramatically increased hit rate on cloudflare side.

2 Likes

@eris static files should be cached for more than 1 year according to pagespeed.

How about we increase that value?

If you have some details on a longer term please share them…

Redownloading static files should be fine every 30 days. I don’t think it will “save” it will matter a lot. Except for pagespeed score that in that cases is overrated…

I have enabled add_header Cache-Control “public”; to one of my client site an will look if it helps bit…

2 Likes

The screenshot doesn’t tell the full story as php pages are never cached an if your theme has a view counter is even less likely.

Unless we have a longer period then it would be use full to see.

maybe developers would like to fix quick installer for wordpress installation?

Quick installer should work fine I use it a lot…

1.6.14
Quick install wordpress error

2023/01/06 13:43:15 [error] 975#0: *2328 FastCGI sent in stderr: "PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/hestia/web/templates/pages/setup_webapp.html:68

Run: v-list-sys-php json

[
“5.6”,
“7.0”,
“7.1”,
“7.2”,
“7.3”,
“7.4”,
“8.0”,
“8.1”
]

Error on:

1.6.14
Quick install wordpress error

2023/01/06 13:43:15 [error] 975#0: *2328 FastCGI sent in stderr: "PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning:  Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/hestia/web/templates/pages/setup_webapp.html:68

It looks like something is wrong with the v-list-web-domain user domain json

Please create a new topic about it is not related to the issue above…

would be interesting to have a default hestia wordpress template file for cloudflare selectable. i assume many are using cloudflare nowadays

when using the method to install wordpress described here, is there a need/advantage to install the „hestia nginx cache“-plugin?

1 Like

Yes it usefull …

2 Likes

thanks

I use it on all my sites that use wordpress and even it is not perfect it is easier then the alternatives with custom templates and building nginx your self

2 Likes