# awstats error showing icons

## UrbanNightmare

Hello all.  I've got awstats on a machine that does not contain the web sites its loging.  They are served by a Windows/IIS server.  I can get the stats page to show up but none of the icons show up.  In my error log its giving me:

[Fri Sep 15 10:38:59 2006] [error] [client 192.168.1.143] script not found or unable to stat: /usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/icon

I've got the awstats.conf file in /etc/apache2/vhosts.d directory and it has these lines:

Alias /awstats/classes "/usr/share/webapps/awstats/6.5-r1/htdocs/classes/"

Alias /awstats/css "{same as above but with /css/}"

Alias /awstats/icon "{same as above but with /icon/}"

ScriptAlias /awstats/ "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/awstats.pl"

ScriptAlias /awstats "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/awstats.pl"

ScriptAlias /awstats.pl "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/awstats.pl"

<Directory "/usr/share/webapps/awstats/6.5-r1/htdocs">

    Options None

    AllowOverride None

    Order allow,deny

    Allow from all

</Directory>

<Directory "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin">

    Options ExecCGI

    AllowOverride None

    Order allow,deny

    Allow from all

</Directory>

From the page the icon source is:

src="/awstats/icon/other/page.png"

I'm not overly familure with all the options Apache has but I'm almost sure its a problem with that.  Shouldn't the alias line "Alias /awstats/icon ..." tell apache where to find the icons?  And if so way is Apache going to the hostroot/cgi-bin directory?

Thanks for any help you can provide.

----------

## badchien

Your apache aliases look ok.

In your awstats config, what do you have set for the DirIcons option?

----------

## UrbanNightmare

Currently set to

    DirIcons="/awstats/icon"

----------

## badchien

I tried using your config, and it works (icons and all), except that I had to remove this ScriptAlias:

```
ScriptAlias /awstats/ "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/awstats.pl" 
```

Also, are you sure your alias for the icon dir is correct?

This is the awstats.conf I am using:

```
Alias /awstats/classes "/usr/share/webapps/awstats/6.5-r1/htdocs/classes/"

Alias /awstats/css "/usr/share/webapps/awstats/6.5-r1/htdocs/css/"

Alias /awstats/icon "/usr/share/webapps/awstats/6.5-r1/htdocs/icon/"

ScriptAlias /awstats "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/awstats.pl"

ScriptAlias /awstats.pl "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/awstats.pl"

<Directory "/usr/share/webapps/awstats/6.5-r1/htdocs">

  Options None

  AllowOverride None

  Order allow,deny

  Allow from all

</Directory>

<Directory "/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin">

  Options ExecCGI

  AllowOverride None

  Order allow,deny

  Allow from all

</Directory>
```

----------

## phorn

It might be that your apache config is going to the wrong directory.

As you can see from that error message, Apache is for whatever reason looking in

/usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/icon 

while it's should be going to:

/usr/share/webapps/awstats/6.5-r1/htdocs/icon

There may be a few reasons for this.

Maybe your aliases are in the wrong order (but badchien's seems to be in the same order).

Maybe it happened because your aliases /awstats/ (notice the / at the end--this may make Apache redirect all subtrees to that folder).  Badchien is missing that first ScriptAlias that you have.

Apache is very picky about aliases at times.

A workaround is to make symbolic links pointing to the right directory (until you can figure out why apache is acting strangely:

```
ln -s /usr/share/webapps/awstats/6.5-r1/htdocs/classes /usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/classes

ln -s /usr/share/webapps/awstats/6.5-r1/htdocs/css /usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/css

ln -s /usr/share/webapps/awstats/6.5-r1/htdocs/icon /usr/share/webapps/awstats/6.5-r1/hostroot/cgi-bin/icon
```

Yeah I have had bad experiences with this same problem.

I was eventually to solve it by changing the  DirIcons="/awstats/icon" to  DirIcons="/awstats-icon", and then making the folders with hyphens point to the right subfolders of /usr/share/webapps/...

----------

