Incorrect document root (nginx)

Discussion in 'Installation/Configuration' started by Loveless, Apr 8, 2017.

  1. Loveless

    Loveless Member

    ISPConfig Version: 3.1.2
    Operating System: Ubuntu 16.04.2 LTS

    I've installed following the Nginx tutorial (not using Apache at all).
    I've created a client with defaults, added a site for it. Now, when I go to Sites and click the one I added,
    under Web Domain it says that Document Root is
    /var/www/clients/client1/web2
    but when I check on disk, this is actually incorrect. The doc-root should be
    /var/www/clients/client1/web2/web
    as far as I can tell, because that is where the index.html resides.
    Strangely though, the nginx vhost file for the site does have the /var/www/domainname/web/ set as root, which is actually a sym-link, which I would never do for nginx, using a symlink as docroot. And why would you?

    Another thing. In trying to avoid unneeded subfolders, I tried changing the Website basedir in the 'System > Server Config > Web' tab from "/var/www" into "/clients" which it accepted as valid, but then when I create a new site, nginx errors out with a 500 error, because it actually uses a wrong doc-root. And the previously created sites do not move, the nginx vhosts don't change with it.
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I supposed /var/www/clients/client1/web2 as root is already correct. The default /web is for the website, /log is for the logs, /ssl is for the SSL certs and etc., so, basically you need them all as they are. Why do you have to change this default?
     
  3. Loveless

    Loveless Member

    It is called "Document Root" on the ISPconfig page. $document_root is not called that in nginx for no reason, it's because it's the root, not some dir upwards.

    If the "Website basedir" is not meant to ever change, then why is it configurable? I have it changed because it is on a mounted NFS. Didn't feel like having to change around all the scripts and configs for that with the arrival of ISPconfig's structure preferences. Note that nobody ever uses anything under just /var or /var/www since it's all placed under /var/www/clients anyway. The higher up names are all symlinks. I don't like symlinks, they're asking for trouble sooner or later.
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Ok. Good luck with that.
     

Share This Page