Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm using ISPConfig on Ubuntu. I want to have separate configs for port 80 and 443 but if I try to add a second server in ISPConfig it won't let me b/c I already have one of the same name.

And anything I add into 'nginx directives' under the Options tab goes in the server block already, so it's already listening on port 80.

Can this be done in ISPConfig?

Thanks.

share|improve this question

1 Answer 1

First thing you should do is copy the original configuration file to a save location so you can customize it. ISPConfig has a built-in conf-custom folder. When ever a file is places in there, having the same name as a server/system/ISPConfig config file, it gets overwritten:

    cp /usr/local/ispconfig/server/conf/nginx_vhost.conf.master /usr/local/ispconfig/server/conf-custom/

Now you can edit the copied file:

    nano /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master

You'll find parts like this:

    <tmpl_if name='ssl_enabled'>

Everything in there will only be applied to SSL enabled sites. So you could create 2 "master blocks" like:

    <tmpl_if name='ssl_enabled'>
        (everything SSL goes here)
    </tmpl_else>
        (everything non SSL goes here)
    </tmpl_if>

That way, you can have two different ways ISPConfig creates the vhosts.

share|improve this answer
    
Obviously, @MaddinXx meant to group server block code in <tmpl_*> processing code blocks and that (as of ISPConfig 3.0.5.4) works to keep the ISPConfig process from throwing 'duplicate' errors when building the config from the (ispconfig/server/conf/*.conf.master) template. But the 'else' block in his example above will drop one server block (:80) for the other (:443) if ssl_enabled. And, it's not enough to 'enable' SSL in the domain tab, you have to generate a certificate in the SSL tab to get ssl_enabled to return a 1. –  Ricalsin Sep 11 at 5:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.