• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Is there any tutorial, how to install and configur basic microcache in Plesk?

Martin.H

Regular Pleskian
As far as now, i did everything what was written in: The Benefits of Microcaching with NGINX - NGINX
but my Server is still not caching anything. Also no files were written in the proxy_cache_path

This are my configs:

/etc/nginx/nginx.conf

#user nginx;
worker_processes auto;
include /etc/nginx/modules.conf.d/*.conf;

events {
worker_connections 2048;
use epoll;
multi_accept on;
}

http {
include mime.types;
default_type application/octet-stream;

fastcgi_cache_path /dev/shm/cache/nginx levels=1:2 keys_zone=microcache:2048m inactive=60m;
fastcgi_temp_path /dev/shm/cache/nginx/tmp;


sendfile on;
keepalive_timeout 65;
server_tokens off;

include /etc/nginx/conf.d/*.conf;
}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;


/etc/nginx/conf.d/proxy_cache.conf (self created)

server {
listen 173.212.192.253:80;
listen 173.212.192.253:443 ssl http2;
listen [2a02:c207:3002:2709::1]:80;
listen [2a02:c207:3002:2709::1]:443 ssl http2;

location / {
add_header X-Cache-Status $upstream_cache_status;
add_header Cache-Control "public";

fastcgi_cache_lock on;
fastcgi_cache_valid 200 1s;
fastcgi_ignore_headers Cache-Control Expires;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache microcache;

fastcgi_buffer_size 128k;
fastcgi_buffers 256 64k;
fastcgi_busy_buffers_size 1024k;
fastcgi_temp_file_write_size 512k;
fastcgi_read_timeout 2m;
fastcgi_buffering on;

}
set $nocache "";
if ($http_cookie ~ (nice_one)) {
set $nocache "true";
}
if ($request_method ~ ^(HEAD|POST)$) {
set $nocache "true";
}
if ($uri ~ (captcha.php)) {
set $nocache "true";
}
if ($uri ~ (admincp)) {
set $nocache "true";
}
}

When I call my site I see that nothing is cached, so I checked the proxy_cache_path (/dev/shm/cache/nginx)

ls -l /dev/shm/cache/nginx
total 0
drwxr-xr-x 2 nginx root tmp

ls -l /dev/shm/cache/nginx/tmp/
total 0

Does anyone know whats wrong and what I have to do to make my Plesk (17.5.3, Debian 8.10) working with microcache?
Btw, both Nginx and Apache are running, not just Nginx.



Thanks in advance!
 
Oh I did not knew this. could you pls tell me how to upgrade to 17.8.9 Beta from 17.5.3 stable, or do I have to create an extra thread for that?
 
Oh I did not knew this. could you pls tell me how to upgrade to 17.8.9 Beta from 17.5.3 stable, or do I have to create an extra thread for that?
Try to do it with

# plesk installer --all-versions
 
Thank you, I upgraded to 17.8.9 but now nothing works. Not even domain.tld:8443, also no SSH.

I have to connect via KVM Consol.
The strange thing is:
Now, when I want to execute "plesk db" it keeps telling me:

exec: "mysql": executable file not found in $PATH

When I run "plesk repair all": (at Repair web server configuration | Reinstall SSL/TLS certificates)

IP address not found on interface(s): xxx.xxx.xxx.xxx .......[ERROR]
Broken binding for domain: domain1.tld ......................[ERROR]
Broken binding for domain: domain2.tld ......................[ERROR]
At "repair web server config on all Domains"

One or more IP addresses registered in Plesk (xxx.xxx.xxx.xxx) are missing from the server\s network interfaces. Domains assigned there UIP addresses (domain1.tld, domain2.tld) are unreachable. Assign valid IP addresses to these domains and rebuild the server configuration files ... [WARNING]

here the log (/var/log/plesk/install/plesk_17.8.9_repair.log)

Trying to start service mysql... /usr/sbin/mysql (pid 721) is running...
done
Trying to establish test connection...
/opt/psa/bootstrapper/pp17.8.9-bootstrapper.sh: line 7394: /usr/bin/mysql: no such file or directory

All this happend after the first restart after the Upgrade.


Is there a way to fix this?
 
Last edited:
Looks like the upgrade was not completed successfully.
What about

# plesk repair installation

?
 
Looks like the upgrade was not completed successfully.
What about

# plesk repair installation

?

A lot of errors and at the end "ERROR: Zend_DB_Adapter_Exception: SQLSTATE[HY000] [2002] Connection refused (Abstract.php144)"

Sorry I cant copy these errors as it is not possible with the KVM Console
 
systemctl status mysql.service:

Starting LSB: Start and stop mysql satabase server daemon ...
mysqld_safe A mysqld process already exists
mysql.service: Control process exited, code=exited status=1
Failed to start LSB: Start and stop the mysql database server daemon.
mysql.service: Unit entered failed stats.
mysql.service: Failed with result 'exit-code'.
 
Try to fix and start mysql service. After that run repair installation again.
 
First I have this Error (pic in attatchment)

Try to fix and start mysql service. After that run repair installation again.

after a reboot the "plesk repair installation" started (bevor it did not start) but now it gives me this error:

Trying to start service mysql... /usr/sbin/mysql (pid 721) is running...
done
Trying to establish test connection...
/opt/psa/bootstrapper/pp17.8.9-bootstrapper.sh: line 7394: /usr/bin/mysql: no such file or directory

and then again
Starting LSB: Start and stop mysql satabase server daemon ...
mysqld_safe A mysqld process already exists
mysql.service: Control process exited, code=exited status=1
Failed to start LSB: Start and stop the mysql database server daemon.
mysql.service: Unit entered failed stats.
mysql.service: Failed with result 'exit-code'.
 

Attachments

  • IP Plesk.PNG
    IP Plesk.PNG
    48 KB · Views: 2
How to fix that?
The FQDN is 100% pointing to the IP of the server.
I just cnfirmed it with nslookup. this is just after the upgrade like this.

is there anything that I can to?
How to rebind the domain which is pointing to the server with the ip?

The strange thing is: even SSH is not working


EDIT:

curl http://localhost | is ok
curl http://localhost:80 | is ok

curl http://localhost:443 | is NOT ok (maybe some Ports blocked by Plesk Firewall?
 

Attachments

  • curl.PNG
    curl.PNG
    21.3 KB · Views: 3
Last edited:
Yup, quite sure Igor is right that SQL isnt running. I figure its MariaDB 10.1+ in your config.

Classic error. Basically Plesk has issues to handle the MariaDB drop in, while expecting mySQL. Esspecially in Centos the System-init-Aliases MariaDB.service, mysql.service and mysqld.service do not work properly to start mysql service (from MariaDB rpm repo). During update Plesk stops MariaDB with "systemctl stop mysql" (that works) and tries to start MariaDB with "systemctl start mysql" (which doesnt work in CentOS due to the dropin).

Depending on your CentOS version you jsut have to fix the startup of MariaDB via mysql.service and your done :)

Most commonly you only need to fix symlinks by systemd in CentOS 7.x:

Code:
#systemctl disable mariadb
#systemctl enable mariadb
#systemctl daemon-reload
 
Last edited:
As far as now, i did everything what was written in: The Benefits of Microcaching with NGINX - NGINX
but my Server is still not caching anything. Also no files were written in the proxy_cache_path

This are my configs:
<snip>

Does anyone know whats wrong and what I have to do to make my Plesk (17.5.3, Debian 8.10) working with microcache?
Btw, both Nginx and Apache are running, not just Nginx.



Thanks in advance!

Configs looked ok at first glance even though I didnt go too deep.

How did you test if your microcache works? With your browser? The one you also used to work on the repective site?

First of all I would start to set no_cache:
set $no_cache false;

Then I suggest to test with a private browser window (ctrl+shift+p in Mozilla, ctrl+shift+n in Chrome)
 
This Thread can be marked an solved.

I just destroyed the Server and deployed a new one fresh on Plesk 17.8.9 and activated Microcaching.
 
Back
Top