• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Awstats + Centos /icons is not working

G

gomibaya

Guest
The awstats package in Centos4 and Plesk 8.1 used an alias dir for the icons:

/awstats-icon

But when the awstats contents is generated, the icon dir is different, instead /awstats-icon is /icon


To fix this issue, is neccesary to change this file:

/usr/share/awstats/awstats_buildstaticpages.pl

and change

my $DirIcons='';

with

my $DirIcons='/awstats-icon';
 
Good fix, thank you for sharing. Indeed this seems the best fix for the problem, just adding a new alias for /icons as said in some other threads is not a "clean way" imo as there is already a /awstats-icon alias... and just changing awstats config in /usr/local/psa/etc/awstats/ is not also a good fix as plesk may overwrite configuration... it is a shame how swsoft did this mistake and didn't released an hotfix to fix it yet, in fact latest hotfix is supposed to fix it but it doesn't... :(
 
just for the information of anyone who have this same problem.

my icons werent showing up (403 error)

the fix is simple, comment the allow from local(127.0.0.1)
Code:
Alias /awstats/icon/ /var/www/awstats/icon/

ScriptAlias /awstats/ /var/www/awstats/
<Directory /var/www/awstats/>
        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
[b]#       deny from all[/b]
        allow from all [b]##127.0.0.1[/b]
</Directory>

#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/
 
From my /etc/cron.daily/50plesk-daily that I had to rename anyway, because Debian doesn't allow files with dots in the cron.daily directory:

## BALU: needed for awstats to allow changing of config dir
export AWSTATS_ENABLE_CONFIG_DIR=1

## BALU: Do some magic perl to replace DirIcons with the correct values
/usr/bin/perl -pi -e 's%DirIcons="/icon"%DirIcons="/awstats-icon"%i' /opt/psa/etc/awstats/awstats*.conf

## BALU: Our customers want German stats
/usr/bin/perl -pi -e 's%^Lang="auto"%Lang="de"%i' /opt/psa/etc/awstats/awstats*.conf
...

I have to wait for the cron run tomorrow to see if it works though ;)

Balu
 
Originally posted by JLChafardet
... the fix is simple, comment the allow from local(127.0.0.1)
Code:
Alias /awstats/icon/ /var/www/awstats/icon/

ScriptAlias /awstats/ /var/www/awstats/
<Directory /var/www/awstats/>
        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
[b]#       deny from all[/b]
        allow from all [b]##127.0.0.1[/b]
</Directory>

#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/
What/where is the file this code is in please?

TIA
 
Better solution

I think that it would be better than editing the .pl file that generates al the awstats files, would be editing the template that is being used to generate those files.

To edit that template, you should edit the file /etc/awstats/awstats.model.conf and chenge the line that says:

DirIcons="/icon"

to

DirIcons="/awstats-icon"

Best regards,

Arnau Marcé
VPS - Servidores Dedicados - [url]www.silicontower.net[/URL]
 
Back
Top