Monday, 7 October 2013

딧 잇 매 블억

Today I was doing website stats checking. I noticed that wp-cron.php was showing up in awstats, despite being included in the Skipfiles section. I then checked my Hostgator account, and wp-cron.php, wp-login.php etc. was being successfully excluded from the stats on there. So I checked the rules being used, and basically they have used every combination you could think of to make sure they are skipped:

SkipFiles="robots.txt$ favicon.ico$ wp-cron.php /wp-cron.php wp-login.php /wp-login.php /xmlrpc.php REGEX[^/wp-includes/] REGEX[^/wp-admin/] REGEX [^.*wp-cron.php.*$] REGEX[^/wp-cron.php] REGEX[^/wp-login.php]"

I can't think that all those different variations are needed, so I wanted to try and do some tests to check which rule was effective. However, when I tried to access my local awstats installation, I got a 502 error. When I tried to start up the perl fcgi wrapper, I got the following error:

perl: symbol lookup error: /home/username/perlModules/lib/perl/5.10.1/auto/FCGI/ undefined symbol: Perl_Gthr_key_ptr

Doing some web searching, I found some advice regarding this error with a different perl module, where the poster fixed it by reinstalling the module. So I downloaded the perl FCGI module and reinstalled it.

After reinstalling it, the perl fcgi wrapper still wouldn't start (same error as before). The new module had installed to /home/username/perlModules/lib/perl/5.14.2 but my $PERL5LIB environment variable only included /home/username/perlModules:/home/username/perlModules/lib/perl/5.10.1. (I install my perl modules to a directory in my home directory as I want to mirror what I can do on the web server, where I don't have root access).

I added the location that the new installation of perl FCGI had installed to to my PERL5LIB environment variable, and then the perl fcgi wrapper script ran successfully.

I refreshed the awstats access web page, but still got a 502 error. After checking the site config I found that the fastcgi_pass directive had the wrong value (probably a location I used to use). So I corrected that, and now got an error Error: No such CGI app. Well, still an error, but at least I'm getting further than I was before.

After amending various things (which involved several nginx restarts - reload doesn't work for some reason, I need to look into that sometime, but it's not really a priority), I finally got the awstats report interface to load in my browser.

At the moment the stats page is empty, so the next stage is to generate the stats from the logs. Then make changes to the awstats SkipFiles setting, visit the page SkipFiles is meant to be excluding. Run the stats update again, and then check if the page has been recorded in the stats or skipped. Repeat until the optimum SkipFiles syntax is found.

But I am quite sleepy now, so I think I will do that tomorrow.

No comments: