Skip to content

Commit

Permalink
Issue #2759735 by helmo, Grimreaper: Rename apache config files to .conf
Browse files Browse the repository at this point in the history
  • Loading branch information
helmo authored and helmo committed Feb 16, 2017
1 parent 428958e commit d87c644
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
20 changes: 16 additions & 4 deletions http/Provision/Config/Apache/server.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,30 @@
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>

<?php
if (drush_get_option('provision_apache_conf_suffix', FALSE)) {
$include_statement = 'IncludeOptional ';
$include_suffix = '/*.conf';
}
else {
$include_statement = 'Include ';
$include_suffix = '';
}

?>

# other configuration, not touched by aegir
# this allows you to override aegir configuration, as it is included before
Include <?php print $http_pred_path ?>
<?php print $include_statement . $http_pred_path . $include_suffix ?>

# virtual hosts
Include <?php print $http_vhostd_path ?>
<?php print $include_statement . $http_vhostd_path . $include_suffix ?>

# platforms
Include <?php print $http_platformd_path ?>
<?php print $include_statement . $http_platformd_path . $include_suffix ?>

# other configuration, not touched by aegir
# this allows to have default (for example during migrations) that are eventually overriden by aegir
Include <?php print $http_postd_path ?>
<?php print $include_statement . $http_postd_path . $include_suffix ?>

<?php print $extra_config; ?>
7 changes: 6 additions & 1 deletion http/Provision/Config/Http/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ class Provision_Config_Http_Site extends Provision_Config_Http {


function filename() {
return $this->data['http_vhostd_path'] . '/' . $this->uri;
if (drush_get_option('provision_apache_conf_suffix', FALSE)) {
return $this->data['http_vhostd_path'] . '/' . $this->uri . '.conf';
}
else {
return $this->data['http_vhostd_path'] . '/' . $this->uri;
}
}

function process() {
Expand Down
7 changes: 7 additions & 0 deletions provision.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@
* $options['provision_backup_suffix'] = '.tar.bz2';
*
* provision_verify_platforms_before_migrate - When migrating many sites turning this off can save time, default TRUE.
*
* provision_backup_suffix - Method to set the compression used for backups... e.g. '.tar.bz2' or '.tar.', defaults to '.tar.gz'.
*
* provision_apache_conf_suffix
* Set to TRUE to generate apache vhost files with a .conf suffix, default FALSE.
* This takes advantage of the IncludeOptional statment introduced in Apache 2.3.6.
* WARNING: After turning this on you need to re-verify all your sites, then then servers,
* and then cleanup the old configfiles (those without the .conf suffix).
*
*/

/**
Expand Down

0 comments on commit d87c644

Please sign in to comment.