AWSatas not updating

Discussion in 'ISPConfig 3 Priority Support' started by Brezlord, Jan 25, 2020.

  1. Brezlord

    Brezlord New Member

    I'm running ISPConfig Version: 3.1dev on CentOS 7.6
    I have run the following
    cd /usr/local/ispconfig/server/
    php cron_debug.php --cronjob=150-awstats.inc.php
    I get the following output
    [root@ispconfig1 server]# php cron_debug.php --cronjob=150-awstats.inc.php
    PHP Warning: fileowner(): stat failed for /usr/lib/cgi-bin/awstats.pl in /usr/local/ispconfig/server/lib/classes/cron.d/150-awstats.inc.php on line 161
    PHP Warning: fileowner(): stat failed for /usr/lib/cgi-bin/awstats.pl in /usr/local/ispconfig/server/lib/classes/cron.d/150-awstats.inc.php on line 161
    PHP Warning: fileowner(): stat failed for /usr/lib/cgi-bin/awstats.pl in /usr/local/ispconfig/server/lib/classes/cron.d/150-awstats.inc.php on line 161
    finished.

    Any help would be appreciated.
     
    Last edited: Jan 26, 2020
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check that you have the CentOS awstats package installed.
     
  3. Brezlord

    Brezlord New Member

    Yes it is installed. Package awstats-7.7-1.el7.noarch already installed and latest version.

    It has been updating but because my ISPconfig server is behind a Nginx reverse proxy I was only seeing the proxy IP address even though I had set up Apache main log config to get the client IP from the X-Forwarded-For header. I worked out after the post that when running tail -f /var/log/httpd/*_log I could see the correct client IPs in the main log but in the site log I still only saw the proxy IP. To fix it i had to edit ISPconfigs log config in
    /etc/httpd/conf/sites-enabled/000-ispconfig.conf
    and change from
    LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    to
    LogFormat "%v %a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    Changing %h to %a, this is the X-Forwarded-For field that is responsible for displaying the correct originating client IP address and would be sent by Nginx reverse proxy to ISPconfig. Wherever you have a logging format definition, replace the %h with %a to use X-Forwarded-For.
    You will also have to enable mod_remoteip.so which was enabled by default on CentOS 7, this might vary for other OS.
    https://www.globo.tech/learning-center/x-forwarded-for-ip-apache-web-server/

    Everything is working as it should now but I still get the same error as in the original post. It would be good if you had a tutorial for setting up the logging when ISPconfig is behind a load ballancer/reverse proxy as there seems to be a lot of people looking for this info but it's hard to find.

    I will confirm everything is working after the next cron update.

    Thanks for getting back to me.
     
    Last edited: Jan 26, 2020

Share This Page