PDA

View Full Version : Simplify config of vhosts


NdK
10th April 2012, 14:34
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>

HIH.

till
10th April 2012, 16:13
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.

NdK
11th April 2012, 12:04
Well, since config files are read only at startup, it's not a big drawback... But if one needs to do some changes manually, it becomes harder to mess it.

BTW, I used that method to add Nagios only to a specific vhost.

till
11th April 2012, 12:50
Well, since config files are read only at startup, it's not a big drawback... But if one needs to do some changes manually, it becomes harder to mess it.

All manual changes in the files get removed automatically. If you want to add some custom directives, use the apache directives field on the options tab of the website settings in ispconfig.

BTW, I used that method to add Nagios only to a specific vhost.

thn your changes will get removed as soon as the vhost is rewritten the next time. To make your changes permanently, add them in the apache directives field.

NdK
12th April 2012, 14:15
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?

till
12th April 2012, 14:30
Well, Nagios vhost isn't "known" to ISPConfig, so it won't get rewritten.

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

but... shouldn't I be allowed to choose that "NNN" on a site-by-site basis?

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.

NdK
12th April 2012, 14:46
I thought you were talking about ispconfig as you posted to the ispconfig forum.

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) :)

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.
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...

till
12th April 2012, 14:49
Uhm... Shouldn't a 'single digit' be enough for that?

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...

I've added this as feature request to the bugtracker.

NdK
12th April 2012, 15:13
The default for Debian based distributions is 3 digits so we used thsi as default for ispconfig too.
Ok. But strange :)

I've added this as feature request to the bugtracker.
Tks!