AWSTATS 404 Error

Discussion in 'Installation/Configuration' started by mattltm, Jan 18, 2014.

  1. mattltm

    mattltm Member

    Webalizer stats are working fine but Awstats produces a 404 error.

    I can see the awstats.domain.xxx.html files in domain.com/web/stats and I can call them directly but visiting www.domain.com/stats produces a 404 error.

    There is an index.php file in domain.com/web/stats.

    Any ideas why it's not working?
     
  2. mattltm

    mattltm Member

    No errors in the log but the access log shows that it's trying to load the file "domain.com/stats/awsindex.html" which does not exist.

    Should that file be created automatically?
     
  3. SpeedyB

    SpeedyB Member HowtoForge Supporter

    Did you ever got this working?

    I have the same problem. And I think it is because the owner and group are ROOT
    When I change the files from 644 to 755 they are displayed.

    Regards,

    Bas
     
  4. mattltm

    mattltm Member

    No. Never found the problem.

    I've also migrated to a new server since then which works fine.
     
  5. BobCat

    BobCat New Member

    Do you have any rewrite rules in the web root directory, which affects the file extensions? Those are inherited to the /stats directory. I had several cases in .htaccess files:

    - DirectoryIndex index.html

    - RewriteRule ^(.*)\.html$ $1.php [nc]

    or:

    Joomla installed in the webroot (htaccess.txt)

    It took me hours to find this.

    You can correct this with a rule in the /stats .htaccess file, but this will be overwritten when you change the statistics credantials.
     
  6. SpeedyB

    SpeedyB Member HowtoForge Supporter

    The problem is probably the same as what I have. That is that the files (.php) must have the eXecute bit turned on to be run.
    I don't know why this is, but I found that this is needed since ... at least a few months. Maybe an update to apache which makes it more secure??
     
  7. BobCat

    BobCat New Member

    Hm..
    just tested on a brand new install (Debian 7, ISPonfig 3.05). No need that .php files need the X bit set. Must be a quirk in your PHP config.
     
  8. mattltm

    mattltm Member

    No special .htaccess rules. Didn't work on any site.

    Moved to a new server and all works as it should. Strange.
     
  9. SpeedyB

    SpeedyB Member HowtoForge Supporter

    I was wondering that, the server was installed as Debian 6 and upgraded to its current level.
    I did some modifications with PHP-Hardening but removed it because it is no longer maintained. The server is in production so not easy to test and modify things :(

    I was thinking it was maybe something in mod_Security but couldn't find anything..
     

Share This Page