diff --git a/src/Service/Http/Apache/Configuration/SiteConfiguration.php b/src/Service/Http/Apache/Configuration/SiteConfiguration.php index 8781979895a12897a3a40eee254545863b07910d..3ac18a68240041ca16b2825815783c4c87768705 100644 --- a/src/Service/Http/Apache/Configuration/SiteConfiguration.php +++ b/src/Service/Http/Apache/Configuration/SiteConfiguration.php @@ -48,6 +48,17 @@ class SiteConfiguration extends Configuration { if (!$this->site_enabled) { $this->template = $this->disabled_template; } - + + $app_dir = $this->context->console_config['config_path'] . '/' . $this->service->getType(); + +// $this->data['http_port'] = $this->service->properties['http_port']; +// $this->data['include_statement'] = '# INCLUDE STATEMENT'; +// $this->data['http_pred_path'] = "{$app_dir}/pre.d"; +// $this->data['http_postd_path'] = "{$app_dir}/post.d"; +// $this->data['http_platformd_path'] = "{$app_dir}/platform.d"; +// $this->data['extra_config'] = ""; + + $this->data['http_vhostd_path'] = "{$app_dir}/vhost.d"; + } } \ No newline at end of file diff --git a/src/Service/Http/Apache/Configuration/vhost.tpl.php b/src/Service/Http/Apache/Configuration/vhost.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..e724bd77d6ee3abd9dec2f5f7986055e64c7a638 --- /dev/null +++ b/src/Service/Http/Apache/Configuration/vhost.tpl.php @@ -0,0 +1,103 @@ +> +site_mail) : ?> + ServerAdmin site_mail; ?> + + +aegir_root) { + $aegir_root = $server->aegir_root; +} +?> + + DocumentRoot root; ?> + + ServerName uri; ?> + + SetEnv db_type + + SetEnv db_name + + SetEnv db_user + + SetEnv db_passwd + + SetEnv db_host + + SetEnv db_port + + +aliases)) { + foreach ($this->aliases as $alias) { + print " ServerAlias " . $alias . "\n"; + } +} +?> + + + RewriteEngine on +redirection || $ssl_redirection) { + + if ($ssl_redirection && !$this->redirection) { + print " # Redirect aliases in non-ssl to the same alias on ssl.\n"; + print " RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [NE,L,R=301]\n"; + } + elseif ($ssl_redirection && $this->redirection) { + print " # Redirect all aliases + main uri to the main https uri.\n"; + print " RewriteRule ^/*(.*)$ https://{$this->uri}/$1 [NE,L,R=301]\n"; + } + elseif (!$ssl_redirection && $this->redirection) { + print " # Redirect all aliases to the main http url.\n"; + print " RewriteCond %{HTTP_HOST} !^{$this->redirection}$ [NC]\n"; + print " RewriteRule ^/*(.*)$ http://{$this->redirection}/$1 [NE,L,R=301]\n"; + } +} +?> + RewriteRule ^/files/(.*)$ /sites/uri; ?>/files/$1 [L] + RewriteCond site_path; ?>/files/robots.txt -f + RewriteRule ^/robots.txt /sites/uri; ?>/files/robots.txt [L] + + + + + # Error handler for Drupal > 4.6.7 + + + SetHandler This_is_a_Drupal_security_line_do_not_remove + + Options None + Options +FollowSymLinks + + # If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + + + + # Prevent direct reading of files in the private dir. + # This is for Drupal7 compatibility, which would normally drop + # a .htaccess in those directories, but we explicitly ignore those + site_path; ?>/private/" > + + SetHandler This_is_a_Drupal_security_line_do_not_remove + + Deny from all + Options None + Options +FollowSymLinks + + # If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + + + +data['http_subdird_path'] . '/' . $this->uri; +if (provision_hosting_feature_enabled('subdirs') && provision_file()->exists($if_subsite)->status()) { + print " Include " . $if_subsite . "/*.conf\n"; +} +?> + +