Where is the document-root creation function located?

Discussion in 'Developers' Forum' started by TobiasHolst, Jan 7, 2017.

  1. TobiasHolst

    TobiasHolst New Member

    I need to place my Websites under /var/www/domain.tld. Symlinks are not an alternative.
    Under ISPConfig 3.1 i have some options in the interface, to change the document_root. But i dont have an directive for the domain, so its not possible to change the directory structure in the interface for my needs.

    I found the following lines in the /usr/local/ispconfig/interface/web/sites/web_vhost_domain_edit.php:

    $document_root = str_replace("[website_id]", $this->id, $document_root);
    $document_root = str_replace("[website_idhash_1]", $this->id_hash($page_form->id, 1), $document_root);
    $document_root = str_replace("[website_idhash_2]", $this->id_hash($page_form->id, 1), $document_root);
    $document_root = str_replace("[website_idhash_3]", $this->id_hash($page_form->id, 1), $document_root);
    $document_root = str_replace("[website_idhash_4]", $this->id_hash($page_form->id, 1), $document_root);

    But if i add an Line for the website domain, it doesn't working. If i comment out these lines, the document_root is also created with the correct website_id, so these lines couldn't be the right.

    Where can i find the function, that creates the document_root an insert it into the database?
     
    Last edited: Jan 7, 2017
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Using the domain name in the real path is not possible in ISPConfig because your websites will break as soon as you change the domain name of a website as many websites and cms store the paths were they are installed in their databases. Of course you can do what you described above by changing the ispconfig sources, but you will not be able to change any domain in ispconfig without breaking your server.

    The file you are seeking is interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php
     
  3. TobiasHolst

    TobiasHolst New Member

    Hi Till,

    Danke für die schnelle Antwort und vielen Dank für deine Warnung. Das ist in der Tat problematisch. Vielleicht sollte ich dann stattdessen lieber /var/www/[website_id] als Pfad wählen. Dann kann sich der Name der Domain im Nachhinein ändern, ohne das sich der Pfad zur Webseite ändert.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ja, das wäre sicher besser, denn aus dem Grund macht ISPConfig das auch mit den ID's, die symlinks sind ja nur dafür da man sich auf der shell die id's nicht merken kann (oder zumindest ich kann es nicht :) ).
     

Share This Page