Different Apache confs for SSL/non-SSL

  • Hello !


    Is it possible, that the SSL and non-SSL Apache configurations get an other include for individual configs ?


    e.g.
    /etc/apache/imscp/domain.conf
    /etc/apache/imscp/domain_ssl.conf


    thanx !

  • Hmmm, I think easiest way to do this is:
    * symlink domain.tld_ssl.conf to domain.tld.conf
    * Add a comment to domain.tld.conf that the admin can delete domain.tld_ssl.conf and add his own custom config for ssl virtual host
    * add into the ssl template the new include path


    I'm not the best in perl... but here are all files where it should be edited:


    Here we have to add and/or delete the symlinks (I think somewhere with the variable APACHE_CUSTOM_SITES_CONFIG_DIR):
    engine/PerlLib/Servers/httpd/apache_fcgi.pm
    engine/PerlLib/Servers/httpd/apache_itk.pm
    engine/PerlLib/Servers/httpd/apache_itk/uninstaller.pm
    engine/PerlLib/Servers/httpd/apache_fcgi/uninstaller.pm
    engine/setup/imscp-migrate-from-ispcp


    Comment must be added here:
    Example: "For custom SSL VirtualHost config delete symlink domain.tld_ssl.conf and create a new file with the same name"
    configs/debian/apache/parts/custom.conf.tpl


    And here:
    configs/debian/apache/parts/domain_ssl.tpl
    on Line 161:
    Include {APACHE_CUSTOM_SITES_CONFIG_DIR}/{DMN_NAME}.conf
    would be:
    Include {APACHE_CUSTOM_SITES_CONFIG_DIR}/{DMN_NAME}_ssl.conf


    Regards
    Fluser

    Edited once, last by fluser ().

  • Can you open a ticket? I've got a better solution for it:


    Three different custom apache2 files:
    configs/debian/apache/parts/custom_combined.conf.tpl
    --> What SSL and no SSL Sites should have configured (for example mod rewrite or proxy)


    configs/debian/apache/parts/custom.conf.tpl
    --> With an include of domain.tld_combined.conf
    >> Can have custom only for no SSL configuration


    configs/debian/apache/parts/custom_ssl.conf.tpl
    --> With an include of domain.tld_combined.conf
    >> Can have custom only for SSL configuration


    Symlink was a bad idea because you would need to enforce custom config in both, non ssl and ssl custom config file. with an include of a combined file, it could be something like that:


    In non-SSL custom file: rewrite a special url to https
    In SSL custom file: proxy redirect of special url to another page or glassfish/tomcat server or redmine
    In combined custom file: rewrite url's from index.php?xyz to info.html or something like that.


    I don't have a lot of time at the moment. But I'm looking forward to implement it on my dev server soon.