custom default template on vhost/website creation

Discussion in 'ISPConfig 3 Priority Support' started by pawan, Jan 13, 2021.

  1. pawan

    pawan Member

    I want to add custom default template, which won't be overwritten on ISPCONFIG upgrade.
    That is I want to create custom index.html which is generated in web-folder.
    how I can do that?
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Copy the standard index file for the language you have set up for the panel (not for the individual user, but the language you see on the login screen) from /usr/local/ispconfig/server/conf/index to /usr/local/ispconfig/server/conf-custom/index and then edit it in that conf-custom folder.
     
    pawan likes this.
  3. pawan

    pawan Member

    can I add additional files in conf-custom folder, will that also be created? or that needs additional steps?
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    No, that is not possible.
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Basically only the files in two folders that can be used for customization, one is already mentioned above and the other is in the /install/tpl folder from ISPConfig install package which should go to /conf-custom/install.

    The other way to customize is directive snippets as it also will not be affected by ISPConfig upgrade.

    The last resort, but is really not needed in majority of cases, is the use of chattr -i command.
     
    Last edited: Jan 14, 2021
    ganewbie and pawan like this.
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I think it is best if I clarify that default ISPConfig index.html (standard_index.html_{lang}) for website is basically in /conf/index/ as well as for favicon.ico and robot.txt, so to customize, copy that into /conf-custom/index/ and edit it in there. The same goes to /conf/error/ and conf/mail/ if you need any of them customized as well, and so long they are in /conf-custom/ they should be ISPConfig upgrade proof.

    However, to read index.php before it or others, other than renaming or deleting index.html, I think a directive snippet as mentioned above may be used, for example in apache2:
    Code:
    DirectoryIndex index.php index.html
    
    In nginx, however such directive snippet may not be possible to overwrite in default vhost, as index is set directly under server block, so only customized vhost may do, though I would suggest the developer to move it to location = / {} block, so its customization becomes possible, but I do not know whether this is the best option.
     
    Last edited: Jan 17, 2021
  7. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    This does not answer his question. He wants PHP code in the default index file so every web has a index file copied to it that has some PHP code, without having to add a .php file manually.

    A different fix for you, @pawan, could be to alter the ISPConfig script to copy over a PHP file instead of a .html
     
  8. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I can't see any of his posts in this thread describing that "he wants php code in the default index file so every web has a index file copied to it that has some PHP code, without having to add a .php file manually", as you mentioned.
    As I quoted above, this is what he said, and thus I clarified the how to in better details.
     
  9. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Oops, remind me not to comment when half sleeping. I thought this was https://www.howtoforge.com/community/threads/apache-directive-to-use-php-in-html.86115/
    :confused:

    My bad.
     

Share This Page