Custom ispconfig.vhost does not work

Discussion in 'Installation/Configuration' started by Wilco, Jul 22, 2024.

  1. Wilco

    Wilco New Member

    Hi all,

    I have a problem with my custom ispconfig.vhost. I copied the vhost.conf.master from /usr/local/ispconfig/server/conf to /usr/local/ispconfig/server/conf-custom. I changed something in the security headers and ran an ISPConfig update. I see that ISPConfig detects the custom vhost file. When the upgrade is done, the vhost file in /etc/apache2/sites-available (ispconfig.vhost) is the same. The changes made in the custom vhost are not replicated to the /etc/apache2/site-available/ispconfig.vhost. I also tried to put the custom vhost in /usr/local/ispconfig/server/conf-custom/install, but this also doesn't work. I'm not sure if I'm doing something wrong. Can someone help me out?
     
    Last edited: Jul 22, 2024
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You put the custom template into the wrong folder. Custom templates of the installer go to /usr/local/ispconfig/server/conf-custom/install/ folder. So when you change a template for the ISPConfig installer or updater, you must put your template into /usr/local/ispconfig/server/conf-custom/install/, only runtime templates go to /usr/local/ispconfig/server/conf-custom/
     
    ahrasis likes this.
  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  4. Wilco

    Wilco New Member

    Hi,

    Yes, I tried that too. I think I'm doing something wrong here. I repeated the steps:
    1. I copied /usr/local/ispconfig/server/conf/vhost.conf.master to /usr/local/ispconfig/server/conf-custom/install/vhost.conf.master.
    2. I made some changes in /usr/local/ispconfig/server/conf-custom/install/vhost.conf.master.
    3. I updated ISPConfig to check if the custom configuration is working.
    My goal is to change some settings in /etc/apache2/sites-available/ispconfig.vhost. In my understanding, this file is replaced with every update. So if I make changes in /usr/local/ispconfig/server/conf-custom/install/vhost.conf.master, I expect that the changes will be processed during the upgrade of ISPConfig and that the ispconfig.vhost file is build with /usr/local/ispconfig/server/conf-custom/install/vhost.conf.master . Is my understanding correct? If not, please correct me!
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    vhost.conf.master is not the ispconfig vhost; vhost.conf.master is the template for websites and not ISPConfig; you should have noticed that this template is entirely different from what's in the ISPConfig vhost file. To modify the ispconfig.vhost, you copy the template of the ispconfig vhost from install/tpl/ folder of the ISPConfig tar.gz file to the conf-custom/install/ folder and modify it. For Apache systems, the template is https://git.ispconfig.org/ispconfig.../apache_ispconfig.vhost.master?ref_type=heads and for Nginx, its https://git.ispconfig.org/ispconfig...l/nginx_ispconfig.vhost.master?ref_type=heads
     
    Wilco and ahrasis like this.
  6. Wilco

    Wilco New Member

    Thank you! I really appreciate it. It works like a charm
     
    till likes this.

Share This Page