Changing Default Site

Discussion in 'General' started by AustJames, Dec 1, 2015.

  1. AustJames

    AustJames New Member

    Hi Everyone,
    I am hoping someone can point me in the right direction regarding a change to the website files that are deployed on creating a new website in ISPConfig 3.

    The Problem

    On creating a new site, an index.html file (and a few other files) are placed in the web folder with the Green banner and text 'Welcome to your website'. I would like to replace the index.html file with a completely new website which has a few levels of files for CSS, JS etc.

    Research So Far
    The copying of this index.html file appears to be controlled by the script apache2_plugin.inc.php (I am running an Apache setup) at location /usr/local/ispconfig/server/plugins-enabled from line 558 to 563. Line 559 specified the following code:
    PHP:
    exec('cp ' $conf['rootpath'] . '/conf/index/standard_index.html_'.substr(escapeshellcmd($conf['language']), 02).' '.escapeshellcmd($data['new']['document_root']).'/' $web_folder '/index.html');
    This code appears to take the index template file depending on the ISPConfig language and creates an index.html file in the root folder of the new site.

    I have modified the above code to the following:
    PHP:
    exec('cp ' $conf['rootpath'] . '/conf/template/*.*')) exec('cp ' $conf['rootpath'] . '/conf/template/*.* '.escapeshellcmd($data['new']['document_root']).'/' $web_folder '/');
    The idea is that the files and sub-folders under /conf/template are copied to the new site root folder; however this is not working and the files are not being copied. The job queue also backs up and nothing is processed.

    If anyone can please provide me with some indication of what I am doing wrong or if there is a simpler way to change the default website copied files when creating a new website it would be much appreciated.

    Thank you
    James
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The apache2 plugin should not be altered as you loose the ability to update ispconfig. Instead, you can create a new plugin that listens on the web_domain_insert event and add your copy command inside this new plugin.
     

Share This Page