Issue with API Access Keys

Hi, nothing happens when I press the the access keys button

Server specs
1.Hestia Control Panel v1.8.11
2.Operating System Debian 12.5 (x86_64)

Hi @trouble,

Thatā€™s weird, show the output of these commands:

v-list-sys-config json | jq -r '.config|to_entries[]|select(.key|startswith("API"))|[.key,.value]|join("=")'
ls -la /usr/local/hestia/web/api/
ls -la /usr/local/hestia/web/list/access-key/

Also, what is the user you are logged on?

root:~# v-list-sys-config json | jq -r ā€˜.config|to_entries|select(.key|startswith(ā€œAPIā€))|[.key,.value]|join(ā€œ=ā€)ā€™
API=yes
API_SYSTEM=1
API_ALLOWED_IP=

root:~# ls -la /usr/local/hestia/web/api/
total 20
drwxr-xr-x 2 root root 4096 Jun 2 01:51 .
drwxr-xr-x 34 root root 4096 Jun 2 01:54 ā€¦
-rw-rā€“r-- 1 root root 11512 Nov 27 2023 index.php

root:~# ls -la /usr/local/hestia/web/list/access-key/
total 12
drwxr-xr-x 2 root root 4096 Jun 2 01:51 .
drwxr-xr-x 21 root root 4096 Jun 2 01:51 ā€¦
-rw-rā€“r-- 1 root root 1659 Nov 27 2023 index.php

I logged into admin and from there moved into the user that I wanted to create the API

I donā€™t have the purge Nginx cache as an option in Hestiaā€™s Control Panel.

That means that you only allow user admin to use API so access key should not be available for normal users, Iā€™ve no idea why the button is shown for your user, it shouldnā€™t (maybe a browser caching issue).

Server setiings -> Configure -> System -> Security -> Enable API access (change it to Enabled for all users) -> Save

imagen

If you are using Nginx + Apache you wonā€™t see that button. If you are using Nginx only, did you enable FastCGI cache for that web domain?

I manage to create the API now. But this plugin doesnā€™t work

Keep getting this error

ā€œThe Hestia Nginx Cache could not be purged!ā€

Iā€™m using Nginx + Apache

That plugin is for Nginx only, not for Nginx+Apache.

How do I clear Nginx cache for Nginx + Apache?

But are you sure you are caching something with Nginx?, are you using any template for your site that contains proxy_cache directives?

Anyway, usually you can purge the cache removing this dir /var/cache/nginx/yourdomain

You can also use v-purge-nginx-cache as it not only works for fastcgi enabled caches.

v-purge-nginx-cache YourUser YourDomain yes

I am developing a website. And I noticed that the content isnā€™t changing.

In any case, Iā€™ll purge cache br removing dir
/var/cache/nginx/yourdomain

root:/# ls /var/cache/nginx/
client_temp fastcgi_temp micro scgi_temp temp uwsgi_temp

The directory does not exist. Nor does directories for any other domains

Thatā€™s because you are not caching with nginx.

How to I enable or disable caching with nginx?

https://blog.nginx.org/blog/nginx-caching-guide

1 Like