Articles in this section

How to change statistics tool from AWStats to GoAccess for domains in Plesk?

kb: technical Plesk Obsidian for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

How to change statistics from AWStats to GoAccess/Webalizer statistics tools in Plesk?

Answer

GoAccess is now the default web statistics tool starting on Plesk Obsidian 18.0.79.
Prior to Plesk version 18.0.79, you may need to install GoAccess from Plesk installer, which is available under Web Hosting option.

Once installed, use your preferred below method to switch to GoAccess:

For one domain
  1. Log in to Plesk.
  2. Go Domains > example.com > Hosting Settings > Web scripting and statistics section**.**
  3. Select the required web statistics utility from the drop-down menu and click Ok


     

For selected/all domains and Service plans in Plesk for Linux
  1. Connect to the Plesk server via SSH.
  2. Create a backup of psa database:

    # plesk db dump > /root/dump_psa_before_script.sql

  3. 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

  4. Run the script webstat-goaccess-change.sh to switch the webstat from AWStats to GoAccess for all domains and Service Plans:

    # ./webstat-goaccess-change.sh

  5. 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;"

For selected/all domains and Service plans in Plesk for Windows
  1. Connect to the Plesk server via RDP.
  2. Start a command prompt as an Administrator.
  3. Create a backup of psa database:

    C:\> plesk db dump psa > C:\psa_backup_webstat.sql

  4. 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 \

  5. 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;"

Was this article helpful?

Comments

5 comments
Date Votes
  • I am not happy, because I don't have the option to select GoAccess.

     

    And yes I have the right version.
     

    Whats wrong here?

    0
  • Kurt, I had to install GoAccess first. Its under the Webhosting tab in the Plesk Installer.It's

    1
  • Thanks. Done.
    But this hint should be added to this page.

     

    0
  • Hello Kurt Ludikovsky

    Thanks for your feedback, the article was updated.

    0
  • If anyone has the same problem while executing the script “webstat-goaccess-change.sh”.

    An error occurred during domain update: An error occurred during changing of hosting settings: The component __webstat_goaccess_support was not installed

    Resyncing Package-Management-Database solved the problem:

    plesk sbin packagemng -sdf
     

    0

Please sign in to leave a comment.