So, when i enable awstats on domain, hestia correctly populates:
“/home/USER/web/DOMAIN/stats” folder with data, and if i go to domain.tld/vstats/ i can see Awstats data.
Problem starts when i want to enable authorization.
When i enable authorization, few things happen:
- .htpasswd file is create in “/home/USER/web/DOMAIN/stats” folder. That file has my username and hashed password in it, as it should
- /home/USER/conf/web/DOMAIN.auth file is created. That file has two lines:
auth_basic "Web Statistics"; auth_basic_user_file /home/USER/web/DOMAIN/stats/.htpasswd;
It basically tells to nginx it should ask for user and pass stored in file from 1)
All fine for now.
3) /home/USER/conf/web/domain/awstats.conf is created with bunch of data in it
I don’t know what exactly that data is, but by the looks of it, it’s bunch of nginx related configuration vars. Should be fine.
But, with all that, i am not asked for authorization if i open stats of that domain.
I took a look into nginx.conf file of that domain, and “stats” location it has this:
location /vstats/ {
alias /home/USER/web/DOMAIN/stats/;
include /home/USER/web/DOMAIN/stats/auth.conf*;
}
As you can see, template thinks that there is “auth.conf*” file in stats folder when there is none.
My wild guess is that “auth.conf*” file is in fact “DOMAIN.auth” file that is created in step 2)
What i do not know is what is real error. Template searching for wrong file in wrong directory, or is DOMAIN.auth file created under wrong directory and under wrong name?
If i edit template so it loads DOMAIN.auth file, authorization works fine. So, i am wondering, what would be long term fix for this? Editing every php-fpm template so that it searches for DOMAIN.auth file, or should i search for file that creates that DOMAIN.auth file and somehow change it so that it creates it under “stats” directory and by name that all templates think it’s called?
My guess is that neather of those fixes will be permanent, and that it should be fixed by commmiting that change to git, but i do not know Hestia good enough so i don’t know which option would be fixing and which one would be reverting to some old state.