• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

plesk-stat/ protecion

M

MaRiOs

Guest
Does anyone knows with what way plesk locks the plesk-stat/ folder?

i made it locked from the hosting setup,
then i went to Protected directories menu and its locked with my username and pass.

But the point is i want to find out what way it uses.
Icould say .htaccess by apache,but I cant find any .htaccess file in the folder....(when i was doing ls -la)

so anyone knows how it locks the folder?
 
Originally posted by MaRiOs
Does anyone knows with what way plesk locks the plesk-stat/ folder?

i made it locked from the hosting setup,
then i went to Protected directories menu and its locked with my username and pass.

But the point is i want to find out what way it uses.
Icould say .htaccess by apache,but I cant find any .htaccess file in the folder....(when i was doing ls -la)

so anyone knows how it locks the folder?

Protection is set up in the Apache config. Have a look at your vhosts/<servername>/conf/httpd.include.
 
And the user/pwd files are kept in:

/home/httpd/vhosts/domain.com/pd

filenames such as: d..foldername
 
ohhhh how didnt i thinked about that?lol
thankx

its in the :

<Directory "/home/httpd/vhosts/domain.tld/httpdocs/plesk-stat">
AuthType Basic
AuthName "Domain statistics"
AuthUserFile /home/httpd/vhosts/domain.tld/pd/d..plesk-stat
require valid-user
</Directory>
 
Ok lets say...that i want to do this :

I want to use this authentication to another folder /cgi-bin/locked/

so each time a new account is created in plesk will be locked with the same attributes that the plesk-stat/ folder is.
meaning that it will be locked with login (username of client) pass(pass of client).

any ideas ?
 
'new account' meaning 'new domain' ?

I assume you are trying to find a shortcut and not have to manually setup the protection each time you create a domain, right?

Have to remember that the httpd.include file is overwritten by Plesk on occasion (like when you make changes to the domain).

(here is one half-asleep thought)

You would write a script to parse the httpd.include file (for all domains you wish this to be effective for) and insert those lines into the proper place in the file.

Setup your script to run in the Event Manager upon domain creation.

Also setup your script to run in CRON at intervals to reinsert the lines in case the httpd.include file gets overwritten.
 
There is better solution: /usr/local/psa/bin/protdir.sh, which allows you to protect directories as Plesk does. There is no need for manually parse/write configs, because this exactly what whole Plesk is about :)
 
Hm.. Iwant... each time a new domain is created in the whole server,
to make a .htaccess file (in a folder that i will put in the skeleton , named ¨locked¨ that will use as login/pass the same info that the plesk-stat folder uses.
that means that the .htaccess file will look like this?? :

AuthName anIdentifier
AuthType Basic
AuthUserFile /home/httpd/vhosts/domain.tld/pd/d..plesk-stat
AuthGroupFile /dev/null
<Limit GET POST>
Require valid-user
</LIMIT>

So i think i need to put on te event manager a script tha will create that file and just put the right domain.tld name in the /home/httpd/vhosts/domain.tld/pd/d..plesk-stat path....

any ideas ?
 
You may want to try replacing the domain.tld with @domain_name@ which should be automatically replaced with the new domain's name by Plesk.
 
so this would work right ? :)


AuthName anIdentifier
AuthType Basic
AuthUserFile /home/httpd/vhosts/@domain_name@/pd/d..plesk-stat
AuthGroupFile /dev/null
<Limit GET POST>
Require valid-user
</LIMIT>
 
should be automatically replaced
I have not tried it and currently my test server is down due to testing out Acronis's software. But using the @domain_name@ tag in other files such as the skeleton index.html file works.

As to the rest of your file contents, I have not even looked at that. I was just answering your question about being able to auto-replace the domain.tld
 
Back
Top