How do I configure AWStats on centos 7 apache ?

Following this guide https://devops.ionos.com/tutorials/how-to-install-and-configure-awstats-on-centos-7/
I'm trying to configure AWStats but get the error
client denied by server configuration: /usr/share/awstats/wwwroot/cgi-bin/

I think I have the apache server configured correctly? Here are the entries in my config files that seem to relate below.

Is the "require ip" and the "allow from" the address of the web client I am using to connect to my linode server? I assume so…

Thanks for the help.

httpd.conf
<Directory "/var/www/cgi-bin">
    Options +ExecCGI
    AddHandler cgi-script .cgi .pl .py
    AllowOverride None
    Options All
    Require all granted
</Directory>

<IfModule alias_module>
  ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

================================================
awstats.conf
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/"

<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require local
        Require ip IP address of the web client I'm connecting from?
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order allow,deny
        Allow from 127.0.0.1
        Allow from IP address of the web client I'm connecting from?
        Allow from ::1
    </IfModule>
</Directory>
# Additional Perl modules
<IfModule mod_env.c>
    SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
</IfModule>

2 Replies

I'm using apache 2.4
I played around with the ip addresses to see which ip would allow access but no luck. I finally added
Require all granted to allow access. I'll probably restrict the url with an .htaccess password.

@RonTech101 --

Re:

Allow from IP address of the web client I'm connecting from?

I think you're on the right track here… You probably don't run browsers on your Linode (i.e., 127.0.0.1 and/or ::1). Your browser runs on a node in someone else's network (Comcast?). That's the thing you have to Allow from

The caveat here is that, unless you're the network operator, your IP address is assigned via DHCP[6] so it can change periodically. You'll have to account for that too.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct