Adding additional assets to root web when adding site

Discussion in 'General' started by Yarnell, Jan 20, 2021.

  1. Yarnell

    Yarnell Member

    I'd like to add some additional assets to the root directory of each new website. Any ideas on how to make this happen?
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Simply use ftp or ssh to do that as default accessible folder is always client's root in ISPConfig, not web folder.
     
  3. Yarnell

    Yarnell Member

    Hi ahrasis, my goal is too automate the process. I'd like to create a new site and have ispconfig automatically generate the files so I can get straight to work. Thanks.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Write your own server-side ISPConfig that binds itself to the "web_domain_insert" insert to do the actions that you want. make sure your plugin name is after the apache and nginx plugin alphabetically to ensure that your code is run after the site has been added and not before the apache or nginx plugin adds the site.
     
  5. Yarnell

    Yarnell Member

    Hmmm. I tried looking for web_domain_insert but I could not not any files. Is this done from within ispconfig? Maybe the directive snippets? And by "your own server-side ISPConfig" do you mean something like a bash file?
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    That should read, "your own server-side ISPConfig plugin" - it needs to be written in php. Refer to a simple existing plugin as an example, eg. https://git.ispconfig.org/ispconfig...gins-available/webmail_symlink_plugin.inc.php shows the use of 'web_domain_insert', copy that to your own name and drop the onInstall() and update() functions as a start (note the use of $data["new"]["document_root"] in update(), which will be useful for you in determining where to copy your files to).
     
    till likes this.
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  8. Yarnell

    Yarnell Member

    Ahhh, php, gotcha. I will give this a go tonight and let yaz know how I make out. Thanks again. :)
     

Share This Page