Building awstats on Rocky Linx 9

  1. First you will need to enable the crd repo with:
    • ~]# dnf config-manager –set-enabled crb
  2. Now you can run:
    • ~]# dnf install awstats

After this on my installation I had to modify the last lines in the httpd.conf file to reflect:

<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    Require all granted
</Directory>

Then I had to add modify the file conf.d/awstats.conf to reflect:

#
# Content of this file, with correct values, can be automatically added to
# your Apache server by using the AWStats configure.pl tool.
#


# If using Windows and Perl ActiveStat, this is to enable Perl script as CGI.
#ScriptInterpreterSource registry


#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path "/usr/share/awstats/" must reflect your AWStats install path.
#
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"


#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4	
        Require local
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order allow,deny
        Allow from 127.0.0.1
        Allow from ::1
    </IfModule>
</Directory>
# Additional Perl modules
<IfModule mod_env.c>
    SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
</IfModule>

The part that has share had to be change from local.

Following this I had to move the legacy GeoIP.dat from the old server at:
/usr/share/GeoIP to the new Rocky server. After this I had to:

  • ~]# dnf install perl-CPAN
  • ~]# cpan
  • cpan[1]> install Geo:IP
  • exit