Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to change statistics from AWStats to GoAccess/Webalizer statistics tools in Plesk?
Answer
- Log in to Plesk.
- Go Domains > example.com > Hosting Settings > Web scripting and statistics section.
-
Select the required web statistics utility from the drop-down menu and click Ok
- Connect to the Plesk server via SSH.
-
Create a backup of psa database:
# plesk db dump > /root/dump_psa_before_script.sql
-
Download the script file (it switches statistics from AWstats to GoAccess for plans and domains) and make it executable:
# wget https://raw.githubusercontent.com/plesk/kb-scripts/master/webstat-goaccess-change/webstat-goaccess-change.sh && chmod +x webstat-goaccess-change.sh
-
Run the script
webstat-goaccess-change.shto switch the webstat from AWStats to GoAccess for all domains and Service Plans:# ./webstat-goaccess-change.sh
-
Make sure that there are no service plans or domains with AWStats webstat (no output should appear as a result of the execution of commands below):
# plesk db "select Templates.id,Templates.name,TmplData.value from Templates, TmplData where Templates.type='domain' and Templates.id=TmplData.tmpl_id and TmplData.element='webstat' and TmplData.value='awstats';"
# plesk db "select domains.name, hosting.webstat from hosting,domains where hosting.webstat='awstats' and hosting.dom_id=domains.id;"
- Connect to the Plesk server via RDP.
- Start a command prompt as an Administrator.
-
Create a backup of psa database:
C:\> plesk db dump psa > C:\psa_backup_webstat.sql
-
Execute the following commands to switch the webstat from AWStats to Webalizer:
C:\> plesk db "update TmplData set value='webalizer' where element='webstat' and value='awstats';"
plesk db -N -e "select domains.name from hosting,domains where hosting.webstat='awstats' and hosting.dom_id=domains.id;" > C:\domains.txt
for /f "tokens=*" %a in ('type C:\domains.txt') do plesk bin domain -u "%a" -webstat webalizer
Make sure that there are no service plans or domains with AWStats webstat (no output should appear as a result of the execution of commands below):
C:\> plesk db "select * from TmplData where element='webstat' and value='awstats';"
plesk db "select domains.name from hosting,domains where hosting.webstat='awstats' and hosting.dom_id=domains.id;"
Comments
I am not happy, because I don't have the option to select GoAccess.
And yes I have the right version.
Whats wrong here?
Kurt, I had to install GoAccess first. Its under the Webhosting tab in the Plesk Installer.It's
Thanks. Done.
But this hint should be added to this page.
Please sign in to leave a comment.