• 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

Statistics wrong

PHornburg

Basic Pleskian
After upgrade to Plesk 11 and activation of nginx the user statistics from awstats were wrong. Normally there were round about 300 users a day and now 1 - 10 per day. They were located from localhost (I think it comes from nginx activation). Even a complete new installation of Plesk 11 and nginx brings no solution.
How can I get correct awstats statistics with activated nginx?
best regards
Peter
 
have you already tried recalculating statistics with:

/usr/local/psa/admin/sbin/statistics --calculate-all
 
PHornburg, please check that you have Apache mod_rpaf on and properly functioning when NGINX is enabled.
 
/usr/local/psa/admin/sbin/statistics --calculate-all was my first try. No result - still the same wrong statistics. The mod_rpaf is on and seems to work. When I stop the service "Reverse-Proxy-Server (nginx)" in the Plesk Panel new visitors were correctly counted in the awstats statistic.
I even made a fresh install on ubuntu 12.04 / Plesk 11.09 (Parallels Plesk Panel v11.0.9_build110120608.16 os_Ubuntu 12.04) and tried it with one domain - the result was the same. Visitors where counted with 127.0.0.1. Do you have any other idea?
best regards
Peter
 
Do you use any other proxying software, e.g. CloudFlare Apache module?

Look into vhost access logs of both Apache and NGINX. What IP addresses do you see?
 
CloudFlare is not active. The proxy_access_log has the correct IPs. The access_log only has the IP from the local host.
 
Try rebuilding the Awstats pages with:

/usr/share/awstats/awstats_buildstaticpages.pl -awstatsprog=/var/www/cgi-bin/awstats/awstats.pl -configdir=/usr/local/psa/etc/awstats -config=domain.org-http -dir=/var/www/vhosts/domain.org/statistics/webstat/current
 
I tried it, but no success. The path was for the rebuild awstats another /usr/share/awstats/tools/awstats_buildstaticpages.pl ...
The access_log still reports only the server IP.
 
abdi, PHornburg, you're mixing the cause and the result. No matter how many times you recalculate statistics or rebuild webstat pages manually, you'll end up with "wrong" IPs since they are present in the Apache access_log.

You need to find a reason why 127.0.0.1 gets logged in Apache logs. Check/recheck: mod_rpaf configuration, Apache logging format string, NGINX configuration. Look at some Apache test pages available in Panel, e.g. for PHP. There should be something like REMOTE_ADDR that contains client IP. What IP do you see there?

If you can't resolve the issue on your own, contact Parallels support or R&D.
 
mod_rpaf ist loaded and the conf looks like this:

<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 85.214.xx.xx::1
</IfModule>

85.214.xx.xx ist the server IP

Loaded Modules:
core mod_log_config mod_logio prefork http_core mod_so mod_aclr2 mod_actions mod_alias mod_auth_basic mod_auth_digest mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_bw mod_cgi mod_dav mod_dav_fs mod_dav_lock mod_deflate mod_dir mod_env mod_fcgid mod_headers mod_include mod_jk mod_mime mod_negotiation mod_perl mod_php5 mod_python mod_reqtimeout mod_rewrite mod_rpaf-2 mod_setenvif mod_ssl mod_status mod_suexec mod_userdir

PHP Info:
REMOTE_ADDR 85.214.xx.xx

nginx conf:
location / { # IPv6 isn't supported in proxy_pass yet.
proxy_pass http://85.214.xx.xx:7080;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Accel-Internal /internal-nginx-static-location;
access_log off;
}

apache2.conf:

apache2.conf
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

I made the change "%h into %{X-Forwarded-For}i" - httpdmng --reconfigure-all and restarted all

no change.
 
You should have:

LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" plesklog

in /usr/local/psa/admin/conf/generated/last_server.include (here the first field and overall number of fields are important);

RPAFproxy_ips 127.0.0.1

in mod_rpaf configuration (you need only proxy IP here, that is localhost);

proxy_pass http://127.0.0.1:7080;
and
proxy_pass https://127.0.0.1:7081;

in vhost NGINX configuration files. This can be changed in webservers' templates (e.g. in /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php , read documentation on how to change them!).

After changing these values back do 'httpdmng --reconfigure-all' and ensure Apache was restarted.
 
Hi Nikolay,

everything done and checked:

The LogFormat in /usr/local/psa/admin/conf/generated/last_server.include is correct: "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" plesklog

RPAF conf contains now only: RPAFproxy_ips 127.0.0.1

The /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php has bost lines as you said:
proxy_pass http://127.0.0.1:7080;
and
proxy_pass https://127.0.0.1:7081;

'httpdmng --reconfigure-all' and apache restart -> no change in access_log. Still the address of the server
 
Any ideas? I just tried a fresh install. No Domain, Ubuntu 12.04, Plesk 11.09 with nginx activated - nothing more. I installed a new domain and tried it - no change in the statistics. Everything above was checked and is correct. When I deactivate nginx the statistics were fine (correct IPs)
 
Any ideas? I just tried a fresh install. No Domain, Ubuntu 12.04, Plesk 11.09 with nginx activated - nothing more. I installed a new domain and tried it - no change in the statistics. Everything above was checked and is correct. When I deactivate nginx the statistics were fine (correct IPs)

Sorry, no ideas, especially if you did a clean install. You may try to use official repositories (for Ubuntu and Plesk) if you're not using them yet. If you already do, I hypothesize it's an updates problem. I.e. Plesk updates might have broken something (please note that this is only my personal unverified opinion!). To check for it you can try to replace all files from the package plesk-core with their original versions from the package. Then run httpdmng --reconfigure-all. This has a potential of breaking you installation, but will prove me right or wrong.
 
ok, I will try that later - first I ask my provider Strato. Maybe there is something wrong with the delivered image. I looked around in the web and found the same problem by other customers of Strato. I think I will get the standard answer of Strato - its´s a Parallels problem - look in the forum, but I will try it.
When I get the answer from Strato I will let you know.
 
Here the same problem with statistics on all domains, on a freshly installed Plesk 11.0.9 update #19.
I don't prefer to switch off nginx proxy server, so I hope Parallels will come with a better solution...
 
Back
Top