Problem Resolutions and GoeIP install
Hi all,
I had the same problems as you, but I've manage to resolve them, so here is what I did:
I use FC2.
-- First the Icon problem.
The resolution is of 2 parts:
1. Locate the file: /etc/awstats/awstats.model.conf and edit the line: DirIcons="/icon" then change it to DirIcons="/awstats/icon" or whatever you like.
This file is used as template when createing the users awstats.conf files.
Please note that after you edit this file you have to go over you clients and change the stats to webalizer and back to awstats so the file can be updated.
2. go in you httpd/conf.d dir and add a file awstats.conf. In the file put Alias /awstats /var/www/html/awstats and restart the server.
This shold fix the icons problem. However you may have to wait till the stats are generated again or run /usr/local/psa/admin/sbin/statistics
-- Installing GeoIP.
Editing the awstats.model.conf is also how you install modules to awstats like GeoIP. However you must install the required conponents for GeoIP.
http://www.maxmind.com/app/perl?rId=awstats this might help
. Till I installed Geo::IP:
urePerl Module I wasn't able to use GeoIP.
Remember to recreate the users conf files before testing.
-- Running awstats dynamic with frames.
I've migrated a clients that was used to dynamic awstats with frames. So i had to add this also ...
To achive this we:
1. in httpd/conf.d/awstats.conf add some rewrite rules so when a client hits /cgi-bin/awstats/awstats.pl without a config param it puts the write param. The rerules also makes sure that it addes -http in the end of the config file, because this is how plesk generates the files:
Code:
<IfModule mod_rewrite.c>
<Directory /var/www/cgi-bin/awstats>
Options ExecCGI FollowSymLinks
Order allow,deny
Allow from all
RewriteEngine on
RewriteCond %{QUERY_STRING} !config=
RewriteRule ^awstats.pl(.*)$ /cgi-bin/awstats/awstats.pl\?config=%{HTTP_HOST}-http [QSA,R,L]
RewriteCond %{QUERY_STRING} !config=[a-zA-Z\.-]+-[a-z]
RewriteCond %{QUERY_STRING} (.*)config=[^&]*(.*)
RewriteRule ^awstats.pl(.*)$ /cgi-bin/awstats/awstats.pl\?%1config=%{HTTP_HOST}-http%2 [R,L]
#RewriteCond %{QUERY_STRING} config=www\.[a-zA-Z\.-]
RewriteCond %{QUERY_STRING} (.*)config=www\.(.*)
RewriteRule ^awstats.pl(.*)$ /cgi-bin/awstats/awstats.pl\?%1config=%2 [R,L]
</Directory>
</IfModule>
now in order for awstats to finds the files my must make them avaliable.
Go to:/usr/local/etc/ and make symlink to: /usr/local/psa/etc/awstats/ in there ... then move the file /etc/awstats/awstats.conf to /usr/local/psa/etc/awstats/
We need this last step because according to the manual when it is invoked awstats searches for config files in /etc/awstats then /use/local/etc/awstats. However it stops the search when it finds the general config file awstats.conf.
Plesk on the other hand generates the files in /usr/local/psa/etc/awstats/. So we make a simple hack to simulate /use/local/etc/awstats and make awstats find the generated files by plesk.
So to be sure we have this correctly we must check that:
1. /etc/awstats directory does NOT contain the file awstats.conf
2. when we make ls -la /usr/local/etc/awstats/ we see the files generated by plesk (4 for each domain) and awstats.conf
This did the trick for me ... I hoped I've been useful to someone.