Awstats and Rails

Discussion in 'Ruby/Rails' started by thijs, Oct 6, 2006.

  1. thijs

    thijs New Member

    I'm setting up the awstats integration, great stuff. I'm running into a problem though.

    I want to place the awstats folder outside of the document root because the app is deployed by Capistrano and the awstats folder does not stay in the same place.

    It gives this error:

    [config:vhost:test:awstats] AWStats working directory: /home/test/awstats/ is not inside virtual host root: (null)/home/test/app/current/, AWStats integration is disabled.

    Is it possible to put the folder outside of the document root and map it with an alias?
    Last edited: Oct 6, 2006
  2. mistwang

    mistwang LiteSpeed Staff

    It is not possible to turn this security feature off with current release.
    However, you can change your vhroot from "/home/test/app/current/" to "/home/test", and adjust the path to rails application if it is relative to the vhroot.
  3. thijs

    thijs New Member

    Thanks, but that wouldn't be a really clean solution.

    It would be great if this security constraint could be loosened in the next release.
  4. mistwang

    mistwang LiteSpeed Staff

    Security is the top priority here, the risk is too high to do that.
    Another solution is to set AWStats working directory to /home/test/app/current/awstats/, and have Capistrano backup and restore it automatically. I think it is doable.
  5. dlhhyct

    dlhhyct New Member

    how about ln?

    ln -s /anywhere/you/want /home/test/app/current/awstats ?
  6. thijs

    thijs New Member

    Sorry, to bring this up again but it's a bit of an annoyance.

    Are there any plans at the moment to allow the awstats directory outside of the public root?

    What exactly are the security problems in doing this. Are there security issues with aliasing an external directory in general?
  7. mistwang

    mistwang LiteSpeed Staff

    You can change your vhost root to "/home/test/", set document root to "/home/test/app/current/", change the "Rails" context location to "/home/test/app/current/" as well.
    This way, you can set awstats working directory to a real directory at "/home/test/awstats".

    You need to instantiate the vhost configuration first if you are using the vhost template.

    Just a simple configuration change. :)
    Last edited: Dec 17, 2006
  8. thijs

    thijs New Member

    Oh, I'm sorry. I misunderstood your reply. This works just fine.

Share This Page