• 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

auto-statistics

M

MaRiOs

Guest
Is there any way to have statistics auto-enabled each time a new hosting is created in plesk ?
 
Create an event handler triggered by Physical Hosting creation.

Event Handler Command would be:

/usr/local/psa/bin/domain.sh -u <new_domain_name> -webstat true

I believe that should do it.
 
you mean /usr/local/psa/bin/domain.sh -u <new_domain_name> -webstat true ??
 
For your Event handler script, that would be correct. Sorry I didn't replace that in my earlier post. It has been edited now.
 
ok it worked fine..
now the difficult part..is to
make that plesk-stat folder locked automatically too :) any idea master ? :D
 
Wasn't that a different posted thread?? I thought you had already resolved that one.

You can setup (another) Event Handler using:
/usr/local/psa/bin/protdir.sh -c plesk-stat -domain <new_domain_name> -type both -passwd thepassword -passwd_type plain -user_name theusername

If I remember correctly, you wanted to make all the plesk-stat directories for all domains have the same username and password (correct me if I'm wrong), so you would fill in the above with 'theusername' and 'thepassword'.

I am too tired to test this one, but you should be able to figure it out, now that you are getting good at Event handlers :)

If the -c option gives any error about directory exists, then try replacing it with -u
(ie. try update instead of create)
 
No its different.

i want this to be done
1.enable stats.
2.lock plesk-stat/ (so that it will create the login/pass
3. use the same to lock another folder.

I just didnt knew that i could use that commmand to lock the other folder too.
I thought i would use the password file of /plesk-stat/ for lokcin the other folder too.
 
so that it will create the login/pass
But you will be supplying the login/pass, right? It will not pick them at random.

If you wanted to use the same /pd/d..plesk-stat auth file, then you could write your own script to modify the domain's vhost.conf file, and run that as an Event.

Hmm, I'm so tired right now I can't think straight, so I may not be on the same wavelength as you, regarding exactly what you are trying to accomplish :)
 
Iused this :

/usr/local/psa/bin/protdir.sh -u "plesk-stat" -domain "<new_domain_name>" -type both -add_user "<new_system_user>" -passwd "<new_system_user_password>"

but its not working.....

maybe its the fault of the " ill try remove them
 
Now it looks like this : /usr/local/psa/bin/protdir.sh -u plesk-stat -domain <new_domain_name> -type both -add_user <new_system_user> -passwd <new_system_user_password>

and still not workin :/
 
ok this makes the trick :

/usr/local/psa/bin/protdir.sh -c plesk-stat -domain <new_domain_name> -type both -add_user <new_system_user> -passwd <new_system_user_password> -title "Domain statistics"


it works.

the question now is ..
can i make it to create folders outsite the httpdocs ? or in the cgi-bin folder?
something like cgi-bin/myprivatecgis/

or cgi scripts can also run from inside the httpdocs folder?
 
Back
Top