Access to /stats for Nextcloud

Discussion in 'Installation/Configuration' started by francoisPE, Feb 5, 2021.

  1. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Hello,
    I run a ispconfig server on ubuntu 20.04 (perfect server set up)
    I install a site with nextcloud. Thanks to ISPC team, I set it up very quickly ;)

    I want to access my.nextcloud.tld/stats (awstat) but it's impossible due to a redirect from Nextcloud...
    I imagine a kind of apache directives like :
    <location /stats>
    DocumentRoot /path/to/awstat
    </location>
    But not sure that's the right option.
    I look for forum but find nothing relevant !
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Try adding
    Code:
    Alias "/stats" "{DOCROOT}/stats"
    to the directive snippets.
     
  3. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I try.
    First, it goes to /stats : it asks me login/pswd for /stats (as set up in ispconfig)
    But, when apache gives access to /stats, it automatically goes back to nextcloud redirection !
     
  4. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I tried
    Redirect permanent /stats {DOCROOT}/stats

    I tried
    <location /stats>
    DocumentRoot {DOCROOT}/stats
    </location>

    but no success !
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Try using {DOCROOT_CLIENT} placeholder instead.
     
  6. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I tried
    Code:
    Alias /stats {DOCROOT_CLIENT}/stats
    in apache directives...
    unfortunately, no success ! :(
     
  7. Steini86

    Steini86 Active Member

    The Problem is that Nextcloud's htaccess redirects all request to Nextcloud (for security reasons?). So you would have to exclude the /stats folder from nextclouds redirects. That is a hack and will not survive Nextcloud updates (I guess).
    In the .htaccess is already a list of files excluded from rewriting. Here you have to add your folder. I have not tried it and don't know if it will work, though ;) https://help.nextcloud.com/t/need-help-exclude-subfolder-path-from-rewrite/31111

    It might be easier to make a new subdomain that accesses the stats folder ... (Not via ISPconfig, but by hand to have the right permissions. Basically, copy the vhost file, rename it and make a subdomain with the stats folder as webroot)
     
    francoisPE likes this.
  8. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Th0m and Steini86 like this.

Share This Page