Simplify config of vhosts

When you have both http and https for the same site, great part of the config is duplicated, while it would be sufficient to save the "core" definition in a file then do:
<VirtualHost *:80>
Include /.../vhost.include
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile ...
Include /.../vhost.include
</VirtualHost>

In your setup, apache has to open two config files while the current setup requires only one file. The vhost files are not made for manual editing anyway, when you want to modify them then you modify the ispconfig vhost master template and in the master template there is only one vhost definition in a loop statement.

Well, Nagios vhost isn't "known" to ISPConfig, so it won't get rewritten.

Speaking of "rewriting config"... I noticed that now, when I edit a vhost, its symlink in /etc/apache2/sites-enabled becomes NNN-hostname. That's OK, but... shouldn't I be allowed to choose that "NNN" on a site-by-site basis? Or am I missing something?

I thought you were talking about ispconfig as you posted to the ispconfig forum.

Click to expand...

Well, other vhosts on that server are managed by ISPConfig. And Nagios was, too. But it became a mess when I needed an upgrade -- too much copying around, so I used the method in the first post to include its "standard Apache config" (from distro packages), enclosing it in an ad-hoc vhost definition (that, incidentally, is the one ISPConfig generated)

till said:

This is set automatically depending on the the auto subdomain you choose to ensure that wildcards come after the domains. So this should not be editable by the user or admin, its managed by ispconfig.

Click to expand...

Uhm... Shouldn't a 'single digit' be enough for that?
Being able to redefine site ordering w/o changing host names is really useful for SNI-enabled servers, to guarantee a predefined ssl-vhost for non-SNI-enabled clients.
And should be really easy to implement...

The default for Debian based distributions is 3 digits so we used thsi as default for ispconfig too.

Being able to redefine site ordering w/o changing host names is really useful for SNI-enabled servers, to guarantee a predefined ssl-vhost for non-SNI-enabled clients.
And should be really easy to implement...