Awstats Images all 403 - Wrong Path/Permissions?

Discussion in 'General' started by bpmee, Mar 2, 2020.

  1. bpmee

    bpmee Member

    My AWSTATS site.com/stats page opens fine with all the correct data.
    Unfortunately, none of the images load. When I view source, the paths are correct: https://site.com/awstatsicons/other/vk.png
    When I try to open the image in a new window, I get a 403 errror.
    Here's my error.log
    Code:
    AH01630: client denied by server configuration: /usr/share/awstats/wwwroot/icon/other/vk.png, referer: https://site.com/stats/awsindex.html
    
    It appears AWSTATS is trying to pull images from /usr/share/awstats... despite the page explicitly showing the site's local image directory.

    Folder permissions are 0755. Tried playing with them, nothing worked.
    User is web:client. Also tried user apache and root, no luck.

    Any ideas? Thanks very much in advance!
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    A quick `grep -R awstats /etc/apache2/` finds this in /etc/apache2/sites-enabled/000-ispconfig.conf:
    Code:
    # allow path to awstats and alias for awstats icons
    <Directory /usr/share/awstats>
            Require all granted
        </Directory>
    
    Alias /awstats-icon "/usr/share/awstats/icon"
    
    You might check if you have that, and anything else you find in that grep. I also note that awstats-icon has a hyphen, whereas your 'correct' path does not, you might check what DirIcons is set to:
    Code:
    # grep -RE 'icons|DirIcons' /etc/awstats/
    /etc/awstats/awstats.conf:# Example: "/awstatsicons"
    /etc/awstats/awstats.conf:DirIcons="/awstats-icon"
    /etc/awstats/awstats.conf:# Logo must be the name of image file (must be in $DirIcons/other directory).
    
     
    bpmee likes this.
  3. bpmee

    bpmee Member

    Thanks so much for your detailed reply! I tracked down the files you mentioned. I'm on CentOS 7.x, so apache is in /etc/httpd. Then I grepped through that directory and /etc/awstats to find the various config files.

    I corrected and double-checked icons paths. It now appears my Apache directory permissions are off. My error log refers to this portion of the /etc/httpd/conf.d/awstats.conf file, **I think**, because I'm getting authz_core errors in my error.log:
    Code:
    [Mon Mar 02 xxxxxx] [authz_core:error] [pidxxxx] [client xxxxxxxxx] AH01630: client denied by server configuration: /usr/share/awstats/wwwroot/icon/browser/safari.png, referer: https://domain.com/stats/awsindex.html
    
    Code:
    <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>
    
    Where should I insert or edit to include something like what you provided?
    Code:
    # allow path to awstats and alias for awstats icons
    <Directory /usr/share/awstats>
            Require all granted
        </Directory>
    
    Alias /awstats-icon "/usr/share/awstats/icon"
     

Share This Page