Commit ac819479 authored by anarcat's avatar anarcat Committed by anarcat

split apache/conf.d in two: pre.d and post.d

this allows the admin to have defaults that are overriden by aegir (for example for migrating sites into aegir) *AND* override aegir configurations manually
parent d43a7d6c
...@@ -17,6 +17,10 @@ NameVirtualHost *:<?php print $http_port; ?> ...@@ -17,6 +17,10 @@ NameVirtualHost *:<?php print $http_port; ?>
LoadModule rewrite_module modules/mod_rewrite.so LoadModule rewrite_module modules/mod_rewrite.so
</IfModule> </IfModule>
# other configuration, not touched by aegir
# this allows you to override aegir configuration, as it is included before
Include <?php print $http_pred_path ?>
# virtual hosts # virtual hosts
Include <?php print $http_vhostd_path ?> Include <?php print $http_vhostd_path ?>
...@@ -24,7 +28,7 @@ Include <?php print $http_vhostd_path ?> ...@@ -24,7 +28,7 @@ Include <?php print $http_vhostd_path ?>
Include <?php print $http_platformd_path ?> Include <?php print $http_platformd_path ?>
# other configuration, not touched by aegir # other configuration, not touched by aegir
Include <?php print $http_confd_path ?> # this allows to have default (for example during migrations) that are eventually overriden by aegir
Include <?php print $http_postd_path ?>
<?php print $extra_config; ?> <?php print $extra_config; ?>
...@@ -41,7 +41,8 @@ class provisionService_http_public extends provisionService_http { ...@@ -41,7 +41,8 @@ class provisionService_http_public extends provisionService_http {
function config_data($config = null, $class = null) { function config_data($config = null, $class = null) {
$data = parent::config_data($config, $class); $data = parent::config_data($config, $class);
if (!is_null($this->application_name)) { if (!is_null($this->application_name)) {
$data['http_confd_path'] = $this->server->http_confd_path; $data['http_pred_path'] = $this->server->http_pred_path;
$data['http_postd_path'] = $this->server->http_postd_path;
$data['http_platformd_path'] = $this->server->http_platformd_path; $data['http_platformd_path'] = $this->server->http_platformd_path;
$data['http_vhostd_path'] = $this->server->http_vhostd_path; $data['http_vhostd_path'] = $this->server->http_vhostd_path;
} }
...@@ -92,7 +93,8 @@ class provisionService_http_public extends provisionService_http { ...@@ -92,7 +93,8 @@ class provisionService_http_public extends provisionService_http {
if (!is_null($this->application_name)) { if (!is_null($this->application_name)) {
$app_dir = "{$this->server->config_path}/{$this->application_name}"; $app_dir = "{$this->server->config_path}/{$this->application_name}";
$this->server->http_confd_path = "{$app_dir}/conf.d"; $this->server->http_pred_path = "{$app_dir}/pre.d";
$this->server->http_postd_path = "{$app_dir}/post.d";
$this->server->http_platformd_path = "{$app_dir}/platform.d"; $this->server->http_platformd_path = "{$app_dir}/platform.d";
$this->server->http_vhostd_path = "{$app_dir}/vhost.d"; $this->server->http_vhostd_path = "{$app_dir}/vhost.d";
} }
...@@ -111,8 +113,9 @@ class provisionService_http_public extends provisionService_http { ...@@ -111,8 +113,9 @@ class provisionService_http_public extends provisionService_http {
function verify() { function verify() {
if ($this->context->type === 'server') { if ($this->context->type === 'server') {
if (!is_null($this->application_name)) { if (!is_null($this->application_name)) {
provision_file()->create_dir($this->server->http_confd_path, dt("Webserver custom configuration"), 0700); provision_file()->create_dir($this->server->http_pred_path, dt("Webserver custom pre-configuration"), 0700);
$this->sync($this->server->http_confd_path); $this->sync($this->server->http_pred_path);
provision_file()->create_dir($this->server->http_postd_path, dt("Webserver custom post-configuration"), 0700);
provision_file()->create_dir($this->server->http_platformd_path, dt("Webserver platform configuration"), 0700); provision_file()->create_dir($this->server->http_platformd_path, dt("Webserver platform configuration"), 0700);
$this->sync($this->server->http_platformd_path, array( $this->sync($this->server->http_platformd_path, array(
......
...@@ -103,6 +103,7 @@ server { ...@@ -103,6 +103,7 @@ server {
####################################################### #######################################################
# virtual hosts # virtual hosts
include <?php print $http_confd_path ?>/*; include <?php print $http_pred_path ?>/*;
include <?php print $http_platformd_path ?>/*; include <?php print $http_platformd_path ?>/*;
include <?php print $http_vhostd_path ?>/*; include <?php print $http_vhostd_path ?>/*;
include <?php print $http_postd_path ?>/*;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment