AWStats page shows error: Couldn't open config file "awstats.example.com-http.conf"

Created:

2017-08-02 23:25:09 UTC

Modified:

2017-08-16 16:23:58 UTC

0

Was this article helpful?


Have more questions?

Submit a request

AWStats page shows error: Couldn't open config file "awstats.example.com-http.conf"

Applicable to:

  • Plesk for Linux

Symptoms

  1. Webstat stopped being calculated for several months.
  2. After AWStats statistics recalculation, the following error is shown on AWStats webpage:
    Error: Couldn't open config file "awstats.example.com-http.conf" nor "awstats.conf" after searching in path "/opt/psa/etc/awstats": No such file or directory
    - Did you use correct config parameter ?
    Example: If your config file is awstats.mysite.conf, use -config=mysite - Did you create your config file 'awstats.example.com-http.conf' ?
    If not, you can run "awstats_configure.pl" from command line, or create it manually.
    Check config file, permissions and AWStats documentation (in 'docs' directory).

Cause

AWStats configuration files are missing in /opt/psa/etc/awstats/awstats.example.com-*

Resolution

  1. Connect to the server using SSH .
  2. Backup /var/www/vhosts/system/example.com/statistics/ folder.

    Warning: It will be deleted if set "webstat" parameter for a subscription to none.

  3. Re-enable AWStats in order to re-create configuration files using the following commands:

    For one domain:

    # plesk bin subscription -u example.com -webstat none
    # plesk bin subscription -u example.com -webstat awstats

    For all domains which use AWStats:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin -sN psa --execute 'SELECT domains.name FROM domains INNER JOIN hosting ON domains.id = hosting.dom_id WHERE hosting.webstat="awstats"' > awstats_domainslist.txt
    # for i in `cat awstats_domainslist.txt`; do plesk bin subscription -u $i -webstat none; done
    # for i in `cat awstats_domainslist.txt`; do plesk bin subscription -u $i -webstat awstats; done

  4. Re-calculate AWStats statistics, as per the article How to recalculate AWStats statistics from logs for previous months .
Have more questions? Submit a request
Please sign in to leave a comment.